init.asm
MAGIC equ 0x1BADB002
FLAGS equ (1 << 0) | (1 << 16)
CHECK equ -(MAGIC + FLAGS)
MBHDR equ 0x00100000
START equ 0x00100000
END_1 equ 0
END_2 equ 0
ENTRY equ init
extern driver_demo
section .text
dd MAGIC
dd FLAGS
dd CHECK
dd MBHDR
dd START
dd END_1
dd END_2
dd ENTRY
init:
;sti
;int 8
cli
mov esp,stack
mov dword[0xB8000+(2*80+2)*2],'WpOp'
mov dword[0xB8000+(2*80+4)*2],'RpKp'
mov dword[0xB8000+(2*80+6)*2],'Sp!p'
;call driver_demo
cli
hlt
section .data
end_stack:
times 4096 db 0
stack:
hexdump:
00000000 02 b0 ad 1b 01 00 01 00 fd 4f 51 e4 00 00 10 00 |.........OQ.....|
00000010 00 00 10 00 00 00 00 00 00 00 00 00 20 00 10 00 |............ ...|
00000020 fa bc 48 10 10 00 c7 05 44 81 0b 00 57 70 4f 70 |..H.....D...WpOp|
00000030 c7 05 48 81 0b 00 52 70 4b 70 c7 05 4c 81 0b 00 |..H...RpKp..L...|
00000040 53 70 21 70 fa f4 00 00 00 00 00 00 00 00 00 00 |Sp!p............|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001040
mbchk:
bin/kernel.bin: The Multiboot header is found at the offset 0.
bin/kernel.bin: Page alignment is turned on.
bin/kernel.bin: Memory information is turned off.
bin/kernel.bin: Address fields is turned on.
bin/kernel.bin: All checks passed.
mit qemu -cdrom geht alles wunderbar (ich nehme kein -fda wg. imagegröße und kein -hda da partitionieren par bashscript ein graus ist.):
cp bin/kernel.bin cdrom_files
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o cdrom.iso cdrom_files
qemu -no-kvm -cdrom cdrom.iso
mit qemu -no-kvm -kernel bin/kernel.bin kommt allerdings nur:
Starting SeaBIOS (version 0.5.1-20100120_010601-rothera)
ich verwende qemu version 0.12.3 .
Wie ist das, ich hatte den Thread versehentlich im falschen Board gepostet - kann er verschoben werden?