flat assembler
Message board for the users of flat assembler.

Index > OS Construction > error Booting with "Linux/i386 Boot Protocol"

Author
Thread Post new topic Reply to topic
MAD_DËMON



Joined: 03 Mar 2006
Posts: 23
MAD_DËMON
I'm trying write my boot code using the Linux Boot Protocol but the loader that I'm using (LILO) prints an error message saying something like:

Zimage is to big try bzImage instead

error: Selected item cannot fit into memory

Code:

SECTION .text

bits 16

times 0x1F1-($$-$) db 0

;old Boot Protocol Header
db 0 ;01F1/1    ALL     setup_sects     The size of the setup in sectors
dw 0 ;01F2/2    ALL     root_flags      If set, the root is mounted readonly
dw 0 ;01F4/2    ALL     syssize         DO NOT USE - for bootsect.S use only
dw 0 ;01F6/2    ALL     swap_dev        DO NOT USE - obsolete
dw 0 ;01F8/2    ALL     ram_size        DO NOT USE - for bootsect.S use only
dw 0 ;01FA/2    ALL     vid_mode        Video mode control
dw 0 ;01FC/2    ALL     root_dev        Default root device number
dw 0xAA55 ;01FE/2       ALL     boot_flag       0xAA55 magic number

;2.00+ Boot protocol
jmp short start ;0200/2 2.00+   jump            Jump instruction
dd 'HdrS' ;0202/4       2.00+   header          Magic signature "HdrS"
dw 0x200 ;0206/2        2.00+   version         Boot protocol version supported
dd 0 ;0208/4    2.00+   realmode_swtch  Boot loader hook (see below)
dw 0 ;020C/2    2.00+   start_sys       The load-low segment (0x1000) (obsolete)
dw 0 ;020E/2    2.00+   kernel_version  Pointer to kernel version string
db 0 ;0210/1    2.00+   type_of_loader  Boot loader identifier
db 0 ;0211/1    2.00+   loadflags       Boot protocol option flags
dw 0 ;0212/2    2.00+   setup_move_size Move to high memory size (used with hooks)
dd 0x100000 ;0214/4     2.00+   code32_start    Boot loader hook (see below)
dd 0 ;0218/4    2.00+   ramdisk_image   initrd load address (set by boot loader)
dd 0 ;021C/4    2.00+   ramdisk_size    initrd size (set by boot loader)
dd 0 ;0220/4    2.00+   bootsect_kludge DO NOT USE - for bootsect.S use only

start

mov ax,0xB800
mov ds,ax

mov dword [0],0x39073807 ; send to B8000h 

hlt
jmp $-1    


also i tried to write the bootcode using the old boot protocol header and LILO displays the same error message, if the bootcode would work it must display at screen the number 98 in the first row

_________________
Tah rah rah boom de ay, I blew some guy away, his brains turned into spray, I was paid well that day
Post 04 Mar 2006, 19:14
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.