Interrupts not working on real hardware

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
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Interrupts not working on real hardware

Post by obiwac »

Hello all!

Recently, octacontrabass pointed out that there was a bug in which running the AQUA on read hardware would crash and restart the computer after the login screen. That has since been fixed (in a version that I have not yet released). So whilst I was fixing it, I realized that IRQs were not working. Why is that? It works fine in virtual machines.

Thanks in advance!
PS: This is my 100th post! Yay! :D
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Interrupts not working on real hardware

Post by Geri »

emulators are creating an ideal environment. meanwhile in real world, the hardware are crapping out from model to model in every variation you can imagine.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Re: Interrupts not working on real hardware

Post by obiwac »

crap. isn't there a way to make emulators simulate a crappy environment? ;)
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Interrupts not working on real hardware

Post by Geri »

you can buy p2 era computers for $5.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
Boris
Member
Member
Posts: 145
Joined: Sat Nov 07, 2015 3:12 pm

Re: Interrupts not working on real hardware

Post by Boris »

Im curious where ?
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: Interrupts not working on real hardware

Post by glauxosdever »

Hi,

geri wrote:emulators are creating an ideal environment. meanwhile in real world, the hardware are crapping out from model to model in every variation you can imagine.
Emulators usually strive to execute the guest code as efficiently as possible. For example, in some (if not all) emulators disk reads happen in one instruction. This causes the guest code to be more efficient, but it distracts OS developers from the reality, where disk reads will take a lot more time.
geri wrote:you can buy p2 era computers for $5.
Do you think there is much point restricting your support to P2 machines and rejecting everything that is newer than that? Because I think there is no point in limiting yourself to older machines (unless you want to ensure your users don't use computers with Intel ME and/or AMD PSP, but then again they will simply choose to use a worse OS (e.g. Windows) that supports their computers to make up for your bad choice of supporting x86 but not actually supporting it)


Regards,
glauxosdever
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: Interrupts not working on real hardware

Post by mallard »

glauxosdever wrote:Do you think there is much point restricting your support to P2 machines and rejecting everything that is newer than that?
Why would getting an old PC to test on prevent you from supporting newer hardware? I've used an old P4 system for real hardware testing of my OS, one thing that makes it more useful than a newer system is the presence of a serial port, allowing me to see debugging output. I have done basic testing (i.e. booting the OS from CD) on more modern hardware, but I certainly don't have the funds to dedicate expensive hardware to OS testing.

Also, it's a good idea to test on every available emulator/virtualiser before testing on real hardware. They each have their own "quirks" and bugs, just like real systems. I do most of my development with QEMU, but I tested on Bochs, VirtualBox and VMWare before real hardware. The kind of differences you see between emulators are similar to the kinds of differences you see between real systems.

If something as fundamental as IRQs aren't working, you're doing something wrong and it's highly likely you'll be able to replicate the issue on a different emulator/virtualiser.
Image
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: Interrupts not working on real hardware

Post by Sik »

To be fair, telling somebody to buy cheap hardware for testing when they already have one such specimen is... kind of redundant =P The whole point of wanting emulators to allow emulation of buggy hardware is to help making debugging easier after all. In the past I've already had to do blind guesses of how hardware would react (due to inaccurate emulators) and it's certainly not that fun.

Anyway: each computer has its own quirks, so you're going to have to find out yourself what's going on (・~・) And double check absolutely everything, some step that may not seem important and that emulators may not care about could be very well critical on some hardware, for instance.
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Re: Interrupts not working on real hardware

Post by obiwac »

So is there no "perfect code" that works on all systems / emulators? Do I really have to work around the quirks of every computer on the planet?
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: Interrupts not working on real hardware

Post by mallard »

It's not really about "working around" the bugs/quirks/differences, the goal is to write code that's generic and tolerant enough that they don't matter. Occasionally you'll find situations where you have little choice but to put in a specific workaround, but these are the exception rather than the rule. Even then, most of these "workarounds" will solve a whole class of issues on certain hardware/emulator configurations, rather than being specific to an individual problem on an individual emulator.
Image
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: Interrupts not working on real hardware

Post by Geri »

glauxosdever wrote:Hi,
Do you think there is much point restricting your support to P2 machines and rejecting everything that is newer than that?
you obviously cant buy 200 pieces of 2000 usd i7/athlonfx/ryzen configurations
p2 caliber of computers should be a good guinea pig
i have a socket7 computer with plenty of pentium1/mmx/amd k5/cyrix cpus for example, if i need something that runs absolutely everywhere, i use that to test
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
Post Reply