I don't think that the full source would help much but I was looking at your code and saw:
;videoseg base 0xB8000 limit 4000
descriptor 48, 0FA0h, 08000h, 0Bh, 092h, 040h, 0
If your kernel is in real mode the videoseg base should be 0xB800 I think(anyone know for sure?). I suggest that maybe you should just use one of John Fine's bootsectors:
http://www.execpc.com/~geezer/johnfine/index.htm
K.J.
screen
Re: screen
ok guys...heres what i found out:
i tried this:
and saw:
HALLO in the 4th line of the screen. The start of the 4zh Line has the offset 0x1E0. Had alook with a hexeditor:
0x1E0: H A L L O . So instead of the adress of message the function is called with 0 instead of message.
Any comments?
i tried this:
Code: Select all
char *message="H A L L O ";
int main()
{
movedata(DATA_SEL, message, SCREEN_DATA_SEL, 0, 3000);
while(1);
}
HALLO in the 4th line of the screen. The start of the 4zh Line has the offset 0x1E0. Had alook with a hexeditor:
0x1E0: H A L L O . So instead of the adress of message the function is called with 0 instead of message.
Any comments?
Re: screen
ok...its going on:
i threw away all the c code and did something in asm.
so i reserved mem for a variable:
a: DW 0x721
;(gray '!')
and i move it to the 1st characer of the vidmem.
mov eax, 0xB8000-0x80000
mov dx, [a]
mov [eax], dx
It works, when the variable is declared at an offset below 0x200. (moved the position of a with TIMES .... nop and looked at it in a hexeditor)
i threw away all the c code and did something in asm.
so i reserved mem for a variable:
a: DW 0x721
;(gray '!')
and i move it to the 1st characer of the vidmem.
mov eax, 0xB8000-0x80000
mov dx, [a]
mov [eax], dx
It works, when the variable is declared at an offset below 0x200. (moved the position of a with TIMES .... nop and looked at it in a hexeditor)
Re: screen
Is this code in a boot sector, or is it a file loaded by your boot sector code. Either way, it looks like you're only loading one sector.
Re: screen
It is a file loaded by the bootsector code.
And no! not just 512b are loaded, cause the Code (Also higher than 0x200 WORKS)
And no! not just 512b are loaded, cause the Code (Also higher than 0x200 WORKS)
Re: screen
"ok...guess we can close the file on that one"
Hmm....i thought....everything above 0x200 is nil, but code over 0x200 works....so i had another look in the bootsectorcode, where the file is loaded and 512 is added to the adress after loading a sector:
mov bx, es
add bx, word [bps] ;<<-----------heres the error
mov es, bx
so i fixed it and now it works.
TY for all the trouble that i've done to you
Hmm....i thought....everything above 0x200 is nil, but code over 0x200 works....so i had another look in the bootsectorcode, where the file is loaded and 512 is added to the adress after loading a sector:
mov bx, es
add bx, word [bps] ;<<-----------heres the error
mov es, bx
so i fixed it and now it works.
TY for all the trouble that i've done to you