Page 1 of 1

kernel Loader problems?

Posted: Fri Jun 12, 2009 10:34 pm
by Tyler24
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

Re: kernel Loader problems?

Posted: Sat Jun 13, 2009 5:55 am
by Mike
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.