Operating system fails?

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator: Moderators

Post Reply
xilvium
Posts: 13
Joined: Sat Feb 14, 2009 3:13 pm
Contact:

Operating system fails?

Post by xilvium » Sat Feb 14, 2009 3:22 pm

First of all, Hello to you all!
Because i am new here.

I have followed all the tutorials for Os Development available at this moment from the resources section.
And i totally love them.
But i have one problem. I followed till i completed tutorial #18 and in virtual pc 2007 it worked perfect.
So i decided to run it on my real hardware. But that generated a instant error.
While it works flawlessly in the emulators.
This is the Error it generates:

Code: Select all

***[i86 hal] i86_default_handler: Unhandled Exception

I dont have to press a key to get that error.
This is my test system:
intel core 2 quad q6600 2.4 ghz p/c
2 gigs ram
msi p6ngm < motherboard

but that shouldn't be a problem i think.
And may i ask if someone can provide me with some information on how to plot a pixel or something :P
Thanks in advance.

~Xilvium

roboman
Posts: 12
Joined: Fri Nov 28, 2008 10:02 pm
Location: usa
Contact:

Post by roboman » Sun Feb 15, 2009 6:13 pm

Can't help you on the first part. The second part, it's most often called a putpixel function. It's mostly a matter of finding the base of the video memory and then ( X * BitsPerPixel )+( Y * BitsPerPixel * PixelsPerLine)+ BaseOfVideoMemory

A google search of 'putpixel asm' will get you lots of examples.

User avatar
Mike
Site Admin
Posts: 465
Joined: Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Sun Feb 15, 2009 6:50 pm

Hello,

That is not an error. That is the default irq being called. If the message gets displayed a few seconds after startup, it may be your PITs irq handler not being properly installed.

If the software you are using is one of the demos, please test <a href="http://www.brokenthorn.com/Resources/OSDev16.html">this tutorials demo</a> on your real machine and let us know what happens.

xilvium
Posts: 13
Joined: Sat Feb 14, 2009 3:13 pm
Contact:

Post by xilvium » Wed Feb 18, 2009 10:06 am

I have compiled the demo you gave me Mike.
But it also does the same on my real hardware while it works in the emulator.
After all the dots dissappear( the loading ) it gives the bluescreen with the yellow text immediately.
But there is nothing wrong with the hardware i know that for sure. Because i can install linux / windows without any problems on it.

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Post by Andyhhp » Thu Feb 19, 2009 4:54 pm

what hardware is it specifically?

also, which IRQ handlers have you installed and which are still using the default interrupt handler?

~andyhhp
Image

xilvium
Posts: 13
Joined: Sat Feb 14, 2009 3:13 pm
Contact:

Post by xilvium » Thu Feb 19, 2009 5:38 pm

This is my hardware:
Intel core 2 quad ( 2,4 ghz per core )
2 gigabyte ram ddr2 ( 667 mhz )
msi p6ngm motherboard
500gig sata hard drive
lg dvd burner
8500gt msi 512mb gddr2
Legacy floppy 1,4" drive

I have based my IRQ handlers from the tutorials they basicly are thesame. If i compile the tutorials they also do not work.
All tutorials work untill the IRQ tutorials then the problem occurs.

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Post by Andyhhp » Thu Feb 19, 2009 10:15 pm

hmm

I suggest you write a small blocking function that prints the specific interrupt number.

Install this function as the General Protection Fault handler and see if you are getting GPFs.

If you are, thats probably because the stack is not being correctly delbt with when trying to return from an interrupt.

~Andyhhp
Image

xilvium
Posts: 13
Joined: Sat Feb 14, 2009 3:13 pm
Contact:

Post by xilvium » Thu Feb 19, 2009 10:26 pm

Thank you for the advice.
I will try that when i find some free time to work on my os again.
But why does it work without any problem in the emulator?
Virtual pc 2007 = working
vmware = working
So i suppose that the problem could be something different then the code.
Even the premade tutorial code (Demo download) errors on my pc.
***[i86 hal] i86_default_handler: Unhandled Exception

User avatar
Mike
Site Admin
Posts: 465
Joined: Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Sun Feb 22, 2009 4:37 am

xilvium wrote:But why does it work without any problem in the emulator?

One of the problems with hardware programming is that it is hard to maintain portability across alot of different machines...emulated environment or not.

You have the same cpu as my primary machine, so I will see if I can further test it myself to see what may be going wrong.

However, if you can, please try the following:

-Some bios's allow you to enable compatibility mode on APICs. If you can, enable compatibility mode and run it to see what happens.

-When the default handler is called, output the value of the PITs tick count by calling the HALs get_tick_count () routine. Please tell us the current tick count when it displays the 'error'.

xilvium
Posts: 13
Joined: Sat Feb 14, 2009 3:13 pm
Contact:

Post by xilvium » Sun Feb 22, 2009 10:57 am

Well i tried your keyboard demo and that didnt give me an error.
But i have no ps/2 keyboard so it didnt work as its supposed to :P
I just got the blue screen with the flickering cursor.
So i ill study that code and see why it works and the other code does not.

User avatar
Mike
Site Admin
Posts: 465
Joined: Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Sun Feb 22, 2009 5:00 pm

xilvium wrote:Well i tried your keyboard demo and that didnt give me an error.
But i have no ps/2 keyboard so it didnt work as its supposed to :P

In most systems, USB keyboards should still work as ps/2 keyboards by the bios. At least until you reprogram the usb controllers, that is.

I am interested that it works, specifically because it is based off of the PIT and IDT developed in the failing demos. If you do find anything, please let me know :)

venk
Posts: 14
Joined: Thu Oct 16, 2008 6:49 am
Contact:

Post by venk » Sun Mar 15, 2009 7:56 am

I am also new to this OS thing, but here are my thoughts:

1) Maybe some key on your keyboard itself is pressed, which is generating an interrupt

2) Maybe the hardware is different than in the emulated environment, so it is generating some interrupt, not generated in emulators. Here are two ways I think might help if this is the case:
<li>Try each interrupt no. separately, and see which interrupt it is, after finding out you can look up somewhere and see what the interrupt does (a loop can be made that assigned odd interrupts to one handler and even ones to another, it will narrow down your search)
<li>See what interrupts are handled in the keyboard demo, which are not handled in this demo, I guess it will help then.
Try other methods first because:
<ul>
<li>This method id very tiring
<li>I am a newbie here myself
</ul>
Best of Luck!!
Help Me!!
SOS!!

Post Reply