Page 1 of 1

int 10h: works in the bootl., but it doesn't in the kernel

Posted: Wed Mar 29, 2006 12:00 am
by scales of justice
Hello,

I've a problem with my small OS, I want to print a single character on the screen, one in the bootloader and one in the kernel,
with this code:

Code: Select all

mov al, "h"
mov ah, 0eh
mov bx, 0007h
int 10h
In the bootloader it works without problems, but the kernel doesn't print the "h"
but the system doesn't crash, after the trial to print the character, it goes on with the rest of my kernel
And for example int 19h works without problems, that's what is confusing me

That's the code of my kernel:

Code: Select all

global start
start:

cli
mov ax, 1000h
mov ds, ax
mov es, ax
sti

mov al, "h"
mov ah, 0eh
mov bx, 0007h
int 10h

ende:
jmp ende
times 512-($-$$) db 0
and that's the code of my bootloader:

Code: Select all

org 7c00h

cli
mov ax, 9000h
mov ss, ax
mov sp,0ffffh
sti

mov al, "h"
mov ah, 0eh
mov bx, 0007h
int 10h

call readbr
mov ax, 0x1000
mov es, ax
mov ds, ax
push ax
xor ax, ax
push ax
retf

readbr:
mov ah, 02h   ;fest
mov al, 01h   ;Anzahl
mov ch, 00h   ;Spur
mov cl, 02h   ;Sektor
mov dh, 00h   ;Kopf
mov dl, 00h   ;Laufwerksnummer
mov bx, 1000h
mov es, bx    ;Segment
mov bx, 0000h ;Offset
int 13h
ret

times 510-($-$$) db 0
signatur dw 0aa55h
Excuse my bad english, I'm German

Re: int 10h: works in the bootl., but it doesn't in the kern

Posted: Wed Mar 29, 2006 12:00 am
by xenos
Are you sure that you are loading the right sector, which contains your kernel? You could use bochs or some other emulator to debug your code and see what's really happening after the far return from your bootloader into the kernel.

If you have more questions, feel free to write me a message in german ;)

Re: int 10h: works in the bootl., but it doesn't in the kern

Posted: Thu Mar 30, 2006 12:00 am
by scales of justice
I'm nearly shure, that I load the right sector,
if I call for example int 19h in the kernel, he does shutdown the computer
only int 10h isn't working

I already looked what's happening after the far jump, but I don't understand it very well, I'm still a beginner with assembler

But I'll write you a message to your email address,
thank you, that you want to help me