Page 1 of 1
Anyone mind telling me why this doesn't work?
Posted: Thu Dec 23, 2010 10:50 pm
by rocko384
I'm probably being a moron, but I can't get this to boot...
Code: Select all
[ORG 0x7c00]
xor ax, ax ; make it zero
mov ds, ax
loop:
mov ah, 0Ch
mov bh, 1
mov al, 0F4h
mov cx, 0
mov dx, 0
add cx, 1
add dx, 1
int 0x10
jmp loop
times 510-($-$$) db 0
db 0x55
db 0xAA
Re: Anyone mind telling me why this doesn't work?
Posted: Thu Dec 23, 2010 11:28 pm
by linuxfood
Suggestions:
1. Be more specific about the error.
1a. Tell us what debugging you've done already.
2. Tell us what you're trying to accomplish.
3. Don't just dump (uncommented!) code and ask us to fix it.
That said,
You appear to be trying to write a pixel in graphics mode, however, you never set it up.
That right there is likely your (first) problem pertinent to what I assume you want to do.
Other issues are that you never setup a stack, and that you aren't doing error checking.
Now, according to RBIL, it looks like function int 0x10 0x0C doesn't return any errors so,
you're a bit hosed there, but you could at least do a 0x0D (read pixel) while you're testing to see if you get what you expect.
-B
Re: Anyone mind telling me why this doesn't work?
Posted: Fri Dec 24, 2010 7:22 am
by Chandra
Did you test this code under real hardware or under emulator?
Hope you won't mind mentioning that along with the result you got.
Re: Anyone mind telling me why this doesn't work?
Posted: Fri Dec 24, 2010 12:26 pm
by rocko384
Sorry...Yeah, I was trying to get pixels to run down the screen, and I was using real hardware. It went straight back to windows, and my test machine had no complaints..
Re: Anyone mind telling me why this doesn't work?
Posted: Fri Dec 24, 2010 4:55 pm
by rocko384
@Berkus, I went to boot menu, and selected CD-drive or w/e. 4th option in the BIOS. So, it doesn't like me =/
Re: Anyone mind telling me why this doesn't work?
Posted: Fri Dec 24, 2010 6:38 pm
by linuxfood
rocko384 wrote:@Berkus, I went to boot menu, and selected CD-drive or w/e. 4th option in the BIOS. So, it doesn't like me =/
That doesn't seem very specific. [emphasis mine.]
Seriously though, have you tried this in an emulator such as Bochs?