618
edits
[unchecked revision] | [unchecked revision] |
m (Move warning to the top of the page) |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1:
{{Tone}}
{{FirstPerson}}
{{
{{Warning|Please see the [[Real Mode OS Warning]] page before continuing.}}
{{Rating|1}}
''In this tutorial we will assemble a small 16-bit [[assembly|assembly language]] kernel with [[NASM]] and boot it.''
Line 26 ⟶ 27:
Here you go, go wild.
<
org 0x7C00 ; add 0x7C00 to label addresses
bits 16 ; tell the assembler we want 16 bit code
Line 182 ⟶ 183:
times 510-($-$$) db 0
dw 0AA55h ; some BIOSes require this signature
</syntaxhighlight>
To assemble on Windows:
<
nasm kernel.asm -f bin -o kernel.bin
partcopy kernel.bin 0 200 -f0
</syntaxhighlight>
Or on Linux:
<
nasm kernel.asm -f bin -o kernel.bin
dd if=kernel.bin of=/dev/sda
</syntaxhighlight>
Those commands assemble your kernel binary and write them to the first disk (sda might be your system disk, so use sdb, sdc etc. according to your configuration. USB-sticks also appear as one of the "sd" devices). Go ahead and test out your operating system now!
Line 206 ⟶ 207:
'''EDIT on December 12 2008: I've written a second part to this tutorial at [[Real mode assembly II]]. This and future parts will have less code to copy and paste and more theory!'''
[[Category:Assembly]]
[[Category:Real mode assembly]]
<- none | [[Real mode assembly II]] ->
|