flat assembler
Message board for the users of flat assembler.

flat assembler > OS Construction > GRUB does not load "kernel"

Author
Thread Post new topic Reply to topic
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
I have tried to boot very minimal multiboot "kernel" with GRUB 0.5.96.1 (found an ready-to-use FAT12 image with it). Here is the source:

Code:

OS_LOAD_ADDR equ 100000h

        use32
        org OS_LOAD_ADDR                ; kernel load address

;-----------------------------------------------------------------------------
; Multiboot header
;-----------------------------------------------------------------------------
MBOOT_HEADER_MAGIC equ 1BADB002h
MBOOT_HEADER_FLAGS equ 00010003h

        align 4
multiboot_header:
        dd MBOOT_HEADER_MAGIC
        dd MBOOT_HEADER_FLAGS
        dd 0-MBOOT_HEADER_MAGIC-MBOOT_HEADER_FLAGS
.aout_kludge:
        dd multiboot_header
        dd OS_LOAD_ADDR
        dd load_end
        dd 0
        dd real_entry

;-----------------------------------------------------------------------------
; Kernel entry from bootloader
;-----------------------------------------------------------------------------
real_entry:

        mov     dword [0B8000h], "OOSS"

        hlt
        jmp     $


load_end:

    


When I try to boot this, GRUB outputs:

Quote:


Booting 'Boot MyOS'

root (fd0)
Filesystem type is fat, using whole disk
kernel /myos/system/kernel.sys

Error 13: Invalid or unsupported executable format

Press any key to continue...

Post 20 Jul 2004, 23:41
View user's profile Send private message Visit poster's website Reply with quote
fasm9



Joined: 19 Jun 2003
Posts: 439
compare your code with unununium OS

http://unununium.org/download-files/releases/uuu-0.1-rc2.tar.bz2

#tar jxf uuu-0.1-rc2.tar.bz2
Post 21 Jul 2004, 00:06
View user's profile Send private message Reply with quote
neonz



Joined: 02 Aug 2003
Posts: 62
Location: Latvia
Ok, I solved the problem by myself. It seems that BSS size field of multiboot header can't be 0. So in this case it must be same as load_end_addr.
Post 21 Jul 2004, 00:49
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-2019, Tomasz Grysztar.

Powered by rwasa.