Have troubles

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
beyondsociety

Have troubles

Post 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?
jrfritz

Re:Have troubles

Post by jrfritz »

A bug in your printf! ::)
jrfritz

Re:Have troubles

Post by jrfritz »

Could also be your loading some incorrect or random data into the registers your print function uses.
hanoi

Re:Have troubles

Post by hanoi »

i had that problem too..
but it doesn't matter actually
jrfritz

Re:Have troubles

Post by jrfritz »

Is that what microsoft said?
hanoi

Re:Have troubles

Post 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...
beyondsociety

Re:Have troubles

Post by beyondsociety »

Code: Select all

A bug in your printf!
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?
Slasher

Re:Have troubles

Post by Slasher »

Post the code, so we can see
Whatever5k

Re:Have troubles

Post by Whatever5k »

hanoi:
actually, I would care about your problem. You never know if it only appears in the bootstrap process...
beyondsociety

Re:Have troubles

Post by beyondsociety »

[attachment deleted by admin]
Curufir

Re:Have troubles

Post 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.
beyondsociety

Re:Have troubles

Post by beyondsociety »

Thanks for the suggestions Curufir :D
Slasher

Re:Have troubles

Post by Slasher »

looks fine to me.
congrats! ;D
Post Reply