kernel Loader problems?

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Tyler24
Posts:1
Joined:Fri Jun 12, 2009 10:28 pm
kernel Loader problems?

Post by Tyler24 » Fri Jun 12, 2009 10:34 pm

Hey, Mike, thanks so much for the tutorials.. really feel like I got up to speed with OS development!

I was just wondering if you're tried loading a large file into memory with the bootloader? When I try to load anything > 28kB, my loader just sits there, with the progress bar stuck. All my "kernel" does is just print some message so I know it loaded... and it won't print the message when kernel.bin > 27-28kB or so.

Code: Select all

org 0xC00
bits 32
jmp kernel



kernel:
                mov     esi, message         ; Tell the user that we're trying
                mov     bx, 0x0702           ; print using attribute 0x7, row 2
print32:
                mov     edi, 0xB8000         ; Text memory base
                xor     eax, eax
                mov     al, bl               ; Compute the offset
                mov     cl, 80 * 2           ; base + 2 * 80 * y
                mul     cl
                add     edi, eax

print32_loop:
                mov     bl, byte [esi]       ; Get next character
                mov     word [edi], bx       ; Write the character
                inc     esi                  ; Move data pointer
                inc     edi                  ; Move memory pointer
                inc     edi
                or      bl, bl               ; If it's not a zero byte
                jne     print32_loop         ; print the next character

halt:
                jmp     halt

message         DB "Kernel loaded!", 0x00

; produce a large binary file.
times           (1024 * 28)-($-$$) db 0x00

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: kernel Loader problems?

Post by Mike » Sat Jun 13, 2009 5:55 am

This issue has been solved. Loading the stage 2 program (which was the issue) to 0x9000 linear and moving the stack to a lower address (0x400 IIRC) resolved the problems.

I decided to post this here in case anyone runs into the same issue.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

Post Reply