Brendan wrote:Hi,
Ready4Dis wrote:Brendan wrote::Of course there are other problems, like being unable to use this method to support multiple video cards.
I dunno, i'll let you know when it fails though. So far it's worked fine on my desktop with nvideo 6800gt, old laptop with intel onboard pos, bochs, qemu, and a few other desktop pc's with various bios/video card combo's.
By "multiple video cards" I meant multiple video cards in the same computer at the same time. For example, my Windows machine has onboard Intel graphics and a GeForce video card and 2 monitors, where the BIOS completely ignores the GeForce video card (but Windows doesn't).
I don't understand how that affects the discussion, whether you use the bios in real-mode or v86, you are still using the bios so it won't support multiple video cards in one system, a proper driver is required, in which case you won't be using either of the above mentioned implentations.
Ready4Dis wrote:It works fine for me, but I don't change my video resolution to often while logging my serial port, so i haven't whitnessed any issues thus far.
Brendan wrote:
In this case you won't have issues caused be interrupt latency - if you're sending data to the serial port (or parallel port, or network card) in the background you'd only get reduced bandwidth, not lost data.
Receiving data (with serial, parallel or network card) is where the problem is (data loss because the IRQ handler isn't executed fast enough to avoid buffer overflows). I'd also expect problems with sound cards (potentially, an audible glitch as the buffer for the digitized sound being played isn't filled quickly enough and problems if you're receiving data from the microphone). For hard disks, floppy drives, CDs, flash memory, etc you'd only get reduced bandwidth (no data loss or other problems). Depending on your OS you may also get system timer clock drift due to missed PIT IRQs. I'm not sure about PS/2 keyboard and mouse (AFAIK the PS/2 controller does flow control while the device buffers data until it can be sent to the controller, so reliability probably depends on the quality of the device and how much data it can fit in it's buffer), or USB devices.
I meant, I don't log data coming to my serial port while changing resolutions, so it's not an issue for me. I am aware that something *may* get interrupted, but if they don't have a video card with vbe3 or a supported video driver, they should be glad it works at all instead of reverting to VGA
. Ok, that's not really true, but I maybe implement v86 if it really does become a problem, but it's not on my todo list right now since what I have works.
Ready4Dis wrote:If I have to change later because of some incompatibilities, then it's not that much of my code that I have to remove/change, and I am still going to try to put as much of it in my driver as possible, since it won't be used unless a valid driver for your video card is not found or supported. I just don't see my resolution changing often enough to cause a huge interrupt in whatever it is you're doing in the background, but maybe in the future I will run into a problem and require changing it, who knows, that's what development is all about, trying things and fixing them if you run into problems.
Brendan wrote:
I'm fussy - in general, for me "minor" problems like system clock drift and reduced bandwidth are unacceptable, and potential data loss (not just proven data loss) is intolerable. If I have to change my implementation later then I've stuffed up and wasted my time. If I also have to change my design because of bad descisions based on bad implementation, then I've stuffed up in the worst possible way. For me, "sort of working for now" is the same as "it never worked at all", and "write once use forever" is my idea of perfect. Disabling interrupts and switching back to real mode isn't acceptable (and neither are the protected mode VBE interfaces and virtual8086, but for performance reasons that don't apply to most people).
Cheers,
Brendan
Well, I don't have system clock drift because that's not how my OS handles time, but that is a good point for others to watch. If I get reduced bandwidth for 100ms while changing my video resolution, to me that is acceptable, especially if you are running without proper drivers. My OS is a work in progress, I don't like to think about every single possible problem that may arise in the future, and never implement it until i'm 100% sure it will be perfect, because then i would never get anywhere, i think about the problem, come up with a solution, think of a few potential problems and the cost to re-write something, and implement. My video driver took me about 30 minutes to write, while you just thinking about and benchmarking, etc took much longer. I can re-implement it using vm86 very easily if needed. While I may have wasted 30 minutes on a working driver that may have potential issues in a very few select cases, it is still better (to me anyways, you don't have to agree with me) than wasting 4 days trying to come up with the 'perfect' fall-back driver. Most things with OS design aren't perfect, and never will be, there are always compromises and things that come up un-planned no matter how long you think about the it and try to make it perfect. A new hardware device might come out that breaks your mold, who knows. I've run into many implementation problems, that's mostly how I learn. I am currently re-writing my OS anyways, and plan to re-implement my vesa driver using the same r-mode fall-back. And, what's wrong with the vbe3 p-mode interface? There is no reason to even leave pmode and go to anything else, no extra exceptions to handle, etc. Only problem I know of is it's lack of support (not sure if it's gotten better since last time I checked). vbe2's pmode interface is rediculous, unless you are double-buffering in video memory, that'd be about the only time it'd be somewhat useful, but probably not worth using in most cases.
Anyways, like I said, I don't mind writing code more than once if I come into a problem, sometimes it's easier to find limitations by implementing, than it is to come up with them by dreaming up situations. You say it never worked, that's fine, I say it worked for what I needed it for at the time. That's why I have all my modules loaded dynamically, I can replace any one of them without breaking other things. Want to replace my video driver, sure point kernel to a different file on disk or replace the current file, it's really not that huge of a deal for me. Now something a bit more complex, like my IPC that would require a major re-write I would be a bit more concerned about, pretty much anything that changes an interface for user apps/drivers I would consider a bit more major to re-write because I then have to fix all the drivers and re-compile everything, but I only have a handful, once i get further along, all that will be worked out, while 'minor' things like a specific drivers implementation that can be replaced very easily, isn't a biggy from my view.