Bochs - Bootloader error

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.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

Combuster wrote:
people who do not even know how to use a compiler will never create anything usuable.
is it just me, or did the original poster just successfully assemble and run a program?! :shock:
Yeah, ok, maybe I was a bit harsh on him. I wasn't in the best of moods yesterday. Seems like a lot of copy/paste though, without really understanding what's going on...


JAL
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

composure 101: when you are having a bad day online, click the red button with the white X in the top right corner. =)

anyways. I think the kid should most deffinately keep asking questions as it not only helps in the learning process, but also helps the others 'brush up'. And no one is FORCED to answer or even read this topic.

I think the Intel manuals are a great place to search for solutions. Second, look at other people's similar code. Pick apart working examples, and then compare it to your own. Then if problem still persists, ask the next question on the forums. But do not overuse the topic by clutterring it with EVERY little issue that you run into. We can help fix problems every now-and-then, but after you get over one big code hurdle, don't immediately post the next... search a bit.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

01000101 wrote:composure 101: when you are having a bad day online, click the red button with the white X in the top right corner. =)
Mmmm... I got a gray one with a black cross...


JAL
User avatar
AlfaOmega08
Member
Member
Posts: 226
Joined: Wed Nov 07, 2007 12:15 pm
Location: Italy

Post by AlfaOmega08 »

I don't know why,,,
I've deleted the old bootloader and writed a new one... It works!!
Just one "problem":
I've to read and write the port 0x70 for disable NMI.
While reading the port 0x70, bochs write on the console:

read of index port 0x70. returning 0xff

then in the AL register i found 0xFF, as if it want to hide the content of the port...
How can I read the port 0x70?

Thanks.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

This is just a wild guess... but perhaps you're reading from the wrong port ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

AlfaOmega08 wrote:I don't know why,,,
I've deleted the old bootloader and writed a new one... It works!!
Just one "problem":
I've to read and write the port 0x70 for disable NMI.
While reading the port 0x70, bochs write on the console:

read of index port 0x70. returning 0xff

then in the AL register i found 0xFF, as if it want to hide the content of the port...
How can I read the port 0x70?
You cannot, it's a write-only port, afaik. See here: http://bochs.sourceforge.net/techspec/PORTS.LST. A quick Google (you should give it a try once, really helpful!) finds me this, in which the following is written:
Rod Pemberton wrote:a) disable NMI, (write 0x8D to port 0x70 (privileged), read port 0x71
(privileged) using 'in' and 'out' instructions)

JAL
User avatar
crazygray
Member
Member
Posts: 73
Joined: Sat Nov 03, 2007 10:17 am
Location: Toky,Japan

Post by crazygray »

frank wrote:You cannot use BIOS interrupts in protected mode. Either load the kernel before going to protected mode or write a floppy driver/hard disk driver.
This is new to me, Write a floppy driver/hard disk driver?
Imagine if a creature came from a 4 dimensional world, would he think you to be flat?
User avatar
AndrewAPrice
Member
Member
Posts: 2309
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

01000101 wrote:_________________
D.i.N.S.
Closed Source OS | v1.05
:: Writing bootloader in C ::
Talking about bootloaders, how is your C bootloader coming along?
My OS is Perception.
Post Reply