Page 1 of 1

Interrupts not working on real hardware

Posted: Mon May 15, 2017 1:47 pm
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

Re: Interrupts not working on real hardware

Posted: Mon May 15, 2017 1:49 pm
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.

Re: Interrupts not working on real hardware

Posted: Mon May 15, 2017 2:29 pm
by obiwac
crap. isn't there a way to make emulators simulate a crappy environment? ;)

Re: Interrupts not working on real hardware

Posted: Mon May 15, 2017 2:32 pm
by Geri
you can buy p2 era computers for $5.

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 12:31 am
by Boris
Im curious where ?

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 1:43 am
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

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 3:04 am
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.

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 3:42 am
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.

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 1:58 pm
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?

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 2:21 pm
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.

Re: Interrupts not working on real hardware

Posted: Tue May 16, 2017 2:24 pm
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