Page 1 of 1
Have troubles
Posted: Thu Jan 09, 2003 5:53 pm
by beyondsociety
I changed a few things in my bootsector that loads into pmode and I am having sort of a problem with it.
When I run my bootsector, it loads two messages and enters protected mode. The last message for some reason gets printed twice instead of once. In front of the duplicated second message is an upside down arrow. By the way, it actually enters into pmode.
Does anybody know what could be wrong without actually looking at the code?
Re:Have troubles
Posted: Thu Jan 09, 2003 6:13 pm
by jrfritz
A bug in your printf! ::)
Re:Have troubles
Posted: Thu Jan 09, 2003 6:15 pm
by jrfritz
Could also be your loading some incorrect or random data into the registers your print function uses.
Re:Have troubles
Posted: Fri Jan 10, 2003 3:29 am
by hanoi
i had that problem too..
but it doesn't matter actually
Re:Have troubles
Posted: Fri Jan 10, 2003 8:25 am
by jrfritz
Is that what microsoft said?
Re:Have troubles
Posted: Fri Jan 10, 2003 9:16 am
by hanoi
Tom: huh?
i just put that print-things out of my bootsector..
i don't care because that won't be interesting for anybody
it isn't in my kernel's print function so i have no problem...
Re:Have troubles
Posted: Fri Jan 10, 2003 12:09 pm
by beyondsociety
No, I checked that
Code: Select all
Could also be your loading some incorrect or random data into the registers your print function uses.
This is probally my problem, I'm checking into it.
Any other suggestions?
Re:Have troubles
Posted: Fri Jan 10, 2003 1:38 pm
by Slasher
Post the code, so we can see
Re:Have troubles
Posted: Fri Jan 10, 2003 2:09 pm
by Whatever5k
hanoi:
actually, I would care about your problem. You never know if it only appears in the bootstrap process...
Re:Have troubles
Posted: Fri Jan 10, 2003 2:30 pm
by beyondsociety
[attachment deleted by admin]
Re:Have troubles
Posted: Fri Jan 10, 2003 4:44 pm
by Curufir
Coupla gripes
Small suggested alteration to this function
Code: Select all
Print_Msg: ; Dump ds:si to screen.
mov ah, 0eh ; Put character
mov bx, 0007 ; Attribute
.1 lodsb ; Load byte at ds:si into al
or al, al ; Test if character is 0 (end)
jz Done
int 0x10 ; Call BIOS
jmp .1
Done:
ret ; Return
You only need to load ah and bx once, int 0x10, 0xe doesn't alter them, loading them every loop is a waste of cycles really.
The other thing would be to make your "Read" function jump back to "Reset_Disk" on failure not back to "Read", just in case a disk reset will fix the problem.
Code looks nice and clean though, very well commented.
Re:Have troubles
Posted: Fri Jan 10, 2003 11:34 pm
by beyondsociety
Thanks for the suggestions Curufir

Re:Have troubles
Posted: Sat Jan 11, 2003 1:04 pm
by Slasher
looks fine to me.
congrats! ;D