I'm glad to see the page has the same idea of writing your BIOS. The page was written by Harrison Hsieh who is my former colleague.
http://biosengineer.blogspot.tw/2007/12/x86-bios4.html
My page just describes how to write a Half BIOS, a program that is performed by CPU at reset vector but it doesn't enable input and output devices. I also demonstrate how to run the Half BIOS with Bochs.
The following are source code of Half BIOS.
HalfBios.asm
Step 1. Build it with MASM611 or above.
> masm HalfBios.asm
The HalfBios.obj is generated.
Step 2. Update bochsrc.bxrc to change romimage file to HalfBios.bin
# romimage: file=../BIOS-bochs-latest
romimage: file=../HalfBios.bin
Step 3. Manually generate HalfBios.bin
> copy BIOS-bochs-latest HalfBios.bin
Please manually copy the 32 bytes with the signature "########" from HalfBios.obj to the offset 1FFE0h in HalfBios.bin. The content of 32 bytes is the program of Half BIOS.
Please make sure that there are EB F3 machine code at the offset 1FFF0h where is reset vector.
Step 4. Run Half BIOS with Bochs in debug mode.
C:\Program Files\Bochs-2.6.6\dlxlinux>..\bochsdbg.exe -f bochsrc.bxrc
We see that CPU performs the Half BIOS at the reset vector, f000:fff0, and then jump POST entry point.
-Count
No comments:
Post a Comment