Babystep1: Difference between revisions

Add QEMU section
[unchecked revision][unchecked revision]
m (Minor improvements and added Tone banner)
(Add QEMU section)
Line 23:
The CPU starts in real mode and the [[BIOS]] loads this code at address 0000:7c00. "times 512-($-$$) db 0" is NASM's way of saying fill up 512 bytes with zeros. And partcopy is going to expect that (200 in Hex = 512 in Decimal). Change it and you'll see partcopy choke.
 
Often, you will see a boot signature (0xAA55) at the end. Older versions of BIOSes looked for this in order to identify a boot sector on a disk. It is evidently unnecessary nowadays, unless you're running the code in QEMU. If it's needed, the last line would be replaced with (or some version of it):
<source lang="asm">
; boot.asm
Line 69:
dd if=boot.bin of=/dev/fd0
</source>
 
==Running the binary in QEMU==
If you don't have an old machine with floppy drive you can still go through the tutorial by using QEMU.
 
<source lang="bash">
qemu-system-i386 -fda boot.bin
</source>
 
Use the QEMU monitor command to send Ctrl-Alt-Del to the VM:
<source lang="bash">
sendkey ctrl-alt-delete
</source>
 
Nowadays even software emulation works fast, so you might want to slow down emulation speed to 1% to notice the reboots.
 
== References ==
Line 77 ⟶ 91:
* Interrupts by number: [http://www.osdever.net/downloads.php]
* Randall Hyde's look into the bowels of the PC: [http://webster.cs.ucr.edu/]
* QEMU [https://www.qemu.org]
 
[[Category:Babystep]]
Anonymous user