|
||||||||||||||||||||||||
Prex Home > Document Index > i386 PC | ||||||||||||||||||||||||
Prex/i386 PC - DocumentationVersion 1.3, 2005/09/05Table of ContentsHOWTO
Quick Hacking GuideThere are following three important points to create a Prex boot floppy for i386-pc.
Here, the difficult step is 2. To write the boot sector, some special tool will be needed. Currently, only DOS utility (mkboot.com) is available in the Prex distribution. So, I recommend you to create the bootable demo floppy at first. Then, you can replace the kernel image to your own kernel in the demo floppy. The following is the most easy step to hack the Prex kernel on i386-pc.
How to create a Prex demo floppy?
How to run Prex with Bochs?Installing BochsBochs is an open-source x86 pc emulator, and you can run Prex with Bochs ons Windows/Linux. The Bochs latest release can be downloaded from http://bochs.sourceforge.net. Setting up for BochsThe Prex demo disk is available for download. The disk image is 1.44M floppy image with FAT file format. And, this image can be used as a Bochs floppy image. You can setup Bochs for Prex by the following steps:
How to run Prex with QEMU?If you are using QEMU, the same image created for Bochs with above info can be used. You can simply try Prex with QEMU by the following command. $ qemu -fda (your directory)/prex-X.X.X.i386-pc.img -localtime How to modify the OS boot image?If you compile the Prex source with "make" command, the OS boot image is created as "prexos" in "img" directory. The file "prexos" must be placed in the root directory of the Prex disk. You can test your own Prex image by replacing the "prexos" in the floppy image. To replace the file in the floppy image, "mtools" is useful. Before using "mcopy", the drive A must be point to the image file in "mtools.conf" as follow: drive a: file="(your directory)/prex-X.X.X.i386-pc.img"Then, the file copy can be performed by: $ mcopy -o prexos a:\ You can use this customized Prex image with Bochs, or you can create an actual bootable floppy disk and test it with the real PC hardware. How to install the boot sector?In order to boot from the floppy disk, you must install the Prex boot sector named "bootsect.bin" into the 1st sector. The DOS program named "mkboot.com" is available to write this boot sector. You can create the Prex bootable floppy by the following steps.
a:\>mkboot a: You can perform these steps within Bochs if you have a DOS bootable image for Bochs. In this case, you have to specify the drive setting of Bochs as follow: floppya: 1_44=dos-boot.img, status=inserted floppyb: 1_44=(your directory)/prex-X.X.X.i386-pc.img, status=insertedThen, type: a:\>mkboot b:Note: You had better download an Prex bootable image rather than this method. Keyboard InterfaceSome special keys are defined by the keyboard driver. Table 1. PC Special Keys
Debugging with BochsBochs has a capability to output the character to the console via i/o port 0xe9. To get your printk() or sys_log() message in the console, you must configure and rebuild Bochs/Prex as follow.
The Bochs console is useful to debug kernel because you can browse or find the log message in the console window. The Bochs internal debugger is also useful to debug kernel. It can be enabled with the following configuration. $ ./configure --enable-debugger --enable-disasm --enable-port-e9-hack |
||||||||||||||||||||||||
Copyright© 2005-2007 Kohsuke Ohtani |