DMA Limitations

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.
mallard
Member
Member
Posts: 280
Joined: Tue May 13, 2014 3:02 am
Location: Private, UK

Re: DMA Limitations

Post by mallard »

Brendan wrote: Sure, why do a nice stream-lined system when you can have a slower, less reliable and less flexible system, plus an eclectic mixture of tools (where various emulators have their own floppy disk catalogues, then additional tools to create and use floppy images).
Forcing people to re-write entire disks every time they are used is not "a nice stream-lined system" at all. It's an awkward, painful to use system that dramatically shortens the lifetime of fragile media.
Brendan wrote:You're just rephrasing what I've said here.
I rephrased it to confirm I understood it correctly. Thank you for confirming that.
Brendan wrote:Except; nobody makes trivial changes to a config file.
I do. Many other "retro computing" enthusiasts do. You're optimising for one specific use-case while seriously degrading the experience for other users. There's nothing wrong with "opinionated software", but it does limit your userbase.
Brendan wrote:You are a worthless butt-hole that has used a flimsy and off-topic excuse to criticise my project (without provocation, and not for the first time) for no reason other than the fact that my design goals differ from yours; so now I'm treating you the way you deserve to be treated.
Wow. I'm very sorry if you feel I have said things that are unjustified. I have always tried to criticise only on technical and "user experience" grounds and would never resort to personal insults. I hold no grudge or ill-will against you or anyone else here. I think a bit or perspective is needed here. Please keep things civil.

There is absolutely room for difference of opinion and different approaches to OSDev (that's pretty much the whole point) and your contributions are as valuable as anyone else's. The only issue I have is that you, unlike most contributors here, typically present your solution to a particular problem as if it's the only "correct" solution, then get incredibly defensive when someone (e.g. me) points out the potential downsides of that approach. Will you at least admit that there are downsides for some number of users (however small you think that number is) to your proposed "image catalogue" approach to floppy disk access?
Brendan wrote:Yes; but "10+" was chosen to be deliberately misleading.
Please refrain from attempting to read my mind. It makes me feel uncomfortable.
Brendan wrote:Specifically; it was chosen to make it sound like people (who aren't OS developers but might want to try an alternative OS) are likely to have an old computer that has a floppy drive, and that therefore there's a valid reason for an OS to support a floppy drive for these users. This is false. People (who aren't OS developers but might want to try an alternative OS) are not likely to still have a computer that is so ancient that it actually has a floppy drive.
Actually, I'm not too bothered by whether or not an OS supports floppy drives (only one of my "target" systems actually has one), I'm simply saying that the "image catalogue" approach isn't going to work well for a significant number of users. Supporting them as an ordinary block device (or whatever your OS's equivalent of that is) is less work, more flexible and fits better to user expectations.
Brendan wrote:However; "plausible 10 years ago" does not mean "actually realistic 10 years ago". For the majority of users, dragging the old computer out from storage and plugging it in is just too much hassle. It's more likely that they'll test on something that they still use regularly simply because it's already in front of them; and even more likely that they simply won't test it at all.
Sure, if they do test your OS, they'll almost certainly want to do it in a VM/emulator first. If they like it there, they might want to install it on an older, lower-specced "secondary" system. Nobody is going to install it on expensive cutting-edge hardware straight away.
Brendan wrote:And you think you are a typical user and that everyone collects retro hardware; and that people who do collect retro hardware are desperate for a new OS because they don't like old things?
No, but I do feel that there are enough "retro computing" enthusiasts and that there is enough crossover with "alternative OS enthusiasts" that sabotaging their user experience is a bad idea. Maybe I'm wrong, but without a substantial user survey, it's hard to tell. At the end of the day, I'm going to be the first "serious" user of my OS, so it darned well better accommodate my needs.
Brendan wrote:You'll think about solving the "very few people have ancient hardware" problem *after* you have a significant userbase that can't exist because a significant number of people don't have ancient hardware? Awesome.
Note that I said "(plus VMs)" when I talked hardware targeting. That's almost certainly going to be most users' first experience of any new "alternative" OS. They're not too bothered that it won't support all the hardware if it's run "natively" on their top-of-the-range brand-new PC; they're not going to wipe out the Windows/Linux/macOS that they use every day for the sake of something with next to no applications. Dual-boot is possible, but realistically most users with a dual-boot system end up using one OS 99% of the time anyway and since the idea of "shutting down" or "rebooting" is quickly becoming anachronistic (in favour of sleep/suspend) dual-boot becomes even less realistic. However, if it supports enough of the hardware in their old, "sitting on the shelf collecting dust" PC to make it useful (e.g. as a virus-immune (due to obscurity at least) web/email machine for their child) then there's a (small) chance they might try it.

Historical precedent is also on my side here. Linux would never have become as popular as it is today if it weren't for the people using it to repurpose older/obsolete hardware; something that is still very common (look at how its market share has doubled since Windows XP was EoL-ed; could that maybe be users looking for a still-supported OS for their old hardware?).
Image
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: DMA Limitations

Post by Brendan »

Hi,
mallard wrote:
Brendan wrote:Sure, why do a nice stream-lined system when you can have a slower, less reliable and less flexible system, plus an eclectic mixture of tools (where various emulators have their own floppy disk catalogues, then additional tools to create and use floppy images).
Forcing people to re-write entire disks every time they are used is not "a nice stream-lined system" at all. It's an awkward, painful to use system that dramatically shortens the lifetime of fragile media.
I agree - forcing people to re-write entire disks simply because they can't use a faster, more reliable and much more convenient (because you don't need a physical disk in a physical drive) catalogue of disk images is incredibly stupid.
mallard wrote:
Brendan wrote:Except; nobody makes trivial changes to a config file.
I do. Many other "retro computing" enthusiasts do. You're optimising for one specific use-case while seriously degrading the experience for other users. There's nothing wrong with "opinionated software", but it does limit your userbase.
I agree - I'm optimising for the largest possible use case, which doesn't include "retro people" that wouldn't want to use a new OS in the first place.
mallard wrote:Will you at least admit that there are downsides for some number of users (however small you think that number is) to your proposed "image catalogue" approach to floppy disk access?
There are always downsides for everything, and if people only considered the downsides they would never do anything. Fortunately most people aren't so stupid - what actually matters is whether the advantages are greater than, or less than, the disadvantages.
mallard wrote:
Brendan wrote:Yes; but "10+" was chosen to be deliberately misleading. Specifically; it was chosen to make it sound like people (who aren't OS developers but might want to try an alternative OS) are likely to have an old computer that has a floppy drive, and that therefore there's a valid reason for an OS to support a floppy drive for these users. This is false. People (who aren't OS developers but might want to try an alternative OS) are not likely to still have a computer that is so ancient that it actually has a floppy drive.
Actually, I'm not too bothered by whether or not an OS supports floppy drives (only one of my "target" systems actually has one), I'm simply saying that the "image catalogue" approach isn't going to work well for a significant number of users. Supporting them as an ordinary block device (or whatever your OS's equivalent of that is) is less work, more flexible and fits better to user expectations.
No; supporting them as a traditional block device means you need to handle seeks, and "media removed at the wrong time", and block caching (including figuring out when the block cache has to be discarded due to media change, and elaborate schemes to get a better compromise between performance and risk - e.g. "write-back block cache for performance, with sync() to minimise risk"), plus a fancy IO scheduling.

What the user expects can be changed in less than 5 minutes simply by showing them something better. It's not a valid excuse for refusing to even consider something that might (or might not) be better.
mallard wrote:
Brendan wrote:And you think you are a typical user and that everyone collects retro hardware; and that people who do collect retro hardware are desperate for a new OS because they don't like old things?
No, but I do feel that there are enough "retro computing" enthusiasts and that there is enough crossover with "alternative OS enthusiasts" that sabotaging their user experience is a bad idea. Maybe I'm wrong, but without a substantial user survey, it's hard to tell. At the end of the day, I'm going to be the first "serious" user of my OS, so it darned well better accommodate my needs.
I'm still not sure if I've ever met any "retro computing enthusuasts" that actually use old hardware (including you).

There are people that collect old things (and don't use them) due to nostalgia (including me a little - I have a "still working as far as I know" Commodore 64 around here some place); and there are people that collect old things as an investment (hoping the value will appreciate) that don't use them (because even scratching the box it originally came in can effect the resale value). These I'd consider true "retro enthusiasts", but neither actually use the old hardware.

Then there are people who can't justify the expense of modern hardware, and use old systems because people give them away for free (which also includes me a little, more so when I was much younger - about 7 of my test machines are literally recycled trash, obtained or free or for "almost nothing" because it was being thrown in the garbage anyway). These people use the old computers, but are not "retro enthusiasts" - they're just "under-funded".
mallard wrote:Historical precedent is also on my side here. Linux would never have become as popular as it is today if it weren't for the people using it to repurpose older/obsolete hardware;
Um, what? Linux became popular as a side-effect of the "Unix wars" (a combination of dissatisfaction with proprietary Unix, GNU needing a kernel and BSD being having legal trouble), and rose in popularity due to use in (mostly new) servers. Being used on "< 10 year old computers" helped a very tiny amount; and being used on ">15 year old computers" didn't help at all (because it's far more cost effective to recycle these computers for scrap metal, then get a free "< 10 year old computer" out of the trash).
mallard wrote:something that is still very common (look at how its market share has doubled since Windows XP was EoL-ed; could that maybe be users looking for a still-supported OS for their old hardware?).
Windows XP market share didn't double when it was EoL-ed (but there are still companies that keep using it due to software compatibility issues that have nothing to do with old hardware).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: DMA Limitations

Post by glauxosdever »

Hi,

so now I'm treating you the way you deserve to be treated.
No one deserves to be treated like that. Even if you feel you have been insulted, please don't push insults back, and certainly please don't push quadrupled insults back.

I'm pretty positive most people would uninstall your OS from their computers if they knew how you behave. Please change that before it's too late.

--------

As for floppies, I don't think it makes sense to spend extra effort and time on something that's obsolete by at least 10 years. It doesn't really matter if the floppy is real of virtual.

For a real floppy, less than 1% of users (and I'm being very optimistic) will boot an OS from such a slow and unreliable media. Part of the nostalgia is also the slowness experienced by the floppy. So, unless you are writing an OS for a specific use case, I don't think there is much point bothering how to speed up something that will not be used anyway.

For a virtual floppy, there might be some users that will actually boot from a floppy. But floppies in emulators are very reliable and much faster than real floppies. So why would you try to optimise (for worse maybe) something that is already fast? And also, if you optimise so virtual floppy reads/writes are faster, why don't you do the same with other storage devices?

Someone may argue that since I did the distinction, it does matter whether the floppy is real or virtual. But in the first case, it will most likely not be ever used. So we are left with the second case, where there is no real reason to try to optimise. Also keep in mind that the optimisation may be optimisation for worse.


Regards,
glauxosdever
User avatar
Sik
Member
Member
Posts: 251
Joined: Wed Aug 17, 2016 4:55 am

Re: DMA Limitations

Post by Sik »

Brendan wrote:
mallard wrote:something that is still very common (look at how its market share has doubled since Windows XP was EoL-ed; could that maybe be users looking for a still-supported OS for their old hardware?).
Windows XP market share didn't double when it was EoL-ed (but there are still companies that keep using it due to software compatibility issues that have nothing to do with old hardware).
Er I think mallard meant Linux market share doubling to replace Windows XP. Though yeah, I also can't imagine that many people installing Linux to make that much of an increase, I imagine nearly everybody just keeps whatever was installed until the hardware finally breaks down.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: DMA Limitations

Post by Brendan »

Hi,
glauxosdever wrote:
so now I'm treating you the way you deserve to be treated.
No one deserves to be treated like that. Even if you feel you have been insulted, please don't push insults back, and certainly please don't push quadrupled insults back.

I'm pretty positive most people would uninstall your OS from their computers if they knew how you behave. Please change that before it's too late.
If pretty positive that, if my OS is ever usable/released, users will look back at the whining and criticism I get from various people (who won't even consider doing anything more than poor re-implementations of tired old ideas), and be completely unable to understand how I manage to resist the temptation to unleash the "wrathful purge" that this forum desperately requires in order to reverse its continuing de-evolution towards a "kindergarten idiocracy" (where those that have learnt not to think and to only regurgitate what they've seen elsewhere have somehow managed to decide they are "superior"; despite the fact that even the most inexperienced beginner has far more potential than they do, simply because an inexperience beginner hasn't been infected by the plague of "failure to consider anything different" yet).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

Lukand wrote:Hi guys,
since some of you already know that I recently finished my floppy driver, I'm dissapointed with one thing : DMA.

I can't believe that DMA could not take more than 16-bit long memory, so basically I could not make use of my allocator and stack for floppy disk purposes. (That probably limits other devices which work on DMA).

Is there any way to avoid this? I mean to read full 32-bit addresses?
Since the floppy drive is very slow, there is no sense in using DMA for it. Just read it with IO-ports instead.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

Octocontrabass wrote:
Lukand wrote:(That probably limits other devices which work on DMA).
The limits only apply to ISA DMA, not other types of DMA.
Lukand wrote:Is there any way to avoid this? I mean to read full 32-bit addresses?
Use a newer device that doesn't rely on ISA DMA, like a USB floppy drive.
Why format a USB disc as a floppy? Makes no sense at all, and it still won't be compatible with the real thing.
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: DMA Limitations

Post by Octocontrabass »

rdos wrote:Why format a USB disc as a floppy? Makes no sense at all, and it still won't be compatible with the real thing.
Who said anything about formatting a USB flash drive like a floppy disk? I was talking about these.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

Brendan wrote:The other alternative is to use PIO, which very slow/wasteful (you literally waste a huge amount of CPU time waiting for each read to happen) but doesn't have any addressing restrictions.
The floppy supports IRQs, so why busy wait for completion? :roll:

But there is a problem with the slow hardware that requires delays of a few microseconds, but if you have those in your OS, you don't need to waste CPU time there either.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

Octocontrabass wrote:
rdos wrote:Why format a USB disc as a floppy? Makes no sense at all, and it still won't be compatible with the real thing.
Who said anything about formatting a USB flash drive like a floppy disk? I was talking about these.
Those are even worse. They have their own USB standard, so you would waste time for sure by supporting those.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

mallard wrote:
Brendan wrote: Also note that (because floppies are slow and relatively unreliable) it might be a good idea for the OS to create/maintain a "floppy disk image catalogue" in memory or on hard disk. In this case, when a floppy disk is inserted you'd read the first track, generate a hash (md5?), and use the hash to find the corresponding floppy disk image in the catalogue;
Well that's just broken. Then what happens when a user puts the disk in another computer and modifies a file (i.e. nothing on the first track; can happen if the file is in a subdirectory and the size doesn't change or on a non-FAT filesystem)? This is almost guaranteed to happen at some point.

Also, physical floppies are more common than you may think (or have any right to be). USB floppy drives use the SCSI command set and therefore cannot read any non-standard formats; most can't even be used with 720KB disks, let alone things like Microsoft's DMF or IBM's XDF "extended" format disks that much early-90s software was distributed on. Anybody who's interested in "retro computing" will have at least one relatively modern system with a standard floppy drive. It's far cheaper and easier to use a standard floppy drive than a specialized "KryoFlux" type device (which is read-only anyway). Note that the sets of alternative-OS hobbyists and retro enthusiasts probably have significant crossover...

Finding a brand-new motherboard with a floppy controller isn't difficult at all, it took me mere seconds to locate one on a popular online retailer's website.
Right. I have a real floppy drive on my test machine, and it's not more than 5-10 years old. It's a 4 core AMD Athlon.

I also have a functional floppy device driver in my OS, but I remember that it was pretty tricky to do, mostly because of strange timing issues.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: DMA Limitations

Post by Brendan »

Hi,
rdos wrote:
Brendan wrote:The other alternative is to use PIO, which very slow/wasteful (you literally waste a huge amount of CPU time waiting for each read to happen) but doesn't have any addressing restrictions.
The floppy supports IRQs, so why busy wait for completion? :roll:
You misunderstand. You get an IRQ (saying that the command started); then you read one word of data, then wait for ages for the next word of data to be ready, then read the next word of data, then wait for ages for the next word of data to be ready, then...

For an old CPU (e.g. from 10 years ago) that's running at 1 GHz and is transferring data from a 1440 KiB floppy, it works out to a best case of 15625 cycles per byte transferred.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
rdos
Member
Member
Posts: 3303
Joined: Wed Oct 01, 2008 1:55 pm

Re: DMA Limitations

Post by rdos »

Brendan wrote: You misunderstand. You get an IRQ (saying that the command started); then you read one word of data, then wait for ages for the next word of data to be ready, then read the next word of data, then wait for ages for the next word of data to be ready, then...
Yes, but if you have a decent scheduler, you can issue a 5 microsecond wait, and do something useful elsewhere while you wait for the hardware.
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: DMA Limitations

Post by linguofreak »

Brendan wrote:
mallard wrote:
Brendan wrote:And you think you are a typical user and that everyone collects retro hardware; and that people who do collect retro hardware are desperate for a new OS because they don't like old things?
No, but I do feel that there are enough "retro computing" enthusiasts and that there is enough crossover with "alternative OS enthusiasts" that sabotaging their user experience is a bad idea. Maybe I'm wrong, but without a substantial user survey, it's hard to tell. At the end of the day, I'm going to be the first "serious" user of my OS, so it darned well better accommodate my needs.
I'm still not sure if I've ever met any "retro computing enthusuasts" that actually use old hardware (including you).

There are people that collect old things (and don't use them) due to nostalgia (including me a little - I have a "still working as far as I know" Commodore 64 around here some place); and there are people that collect old things as an investment (hoping the value will appreciate) that don't use them (because even scratching the box it originally came in can effect the resale value). These I'd consider true "retro enthusiasts", but neither actually use the old hardware.
I have and sporadically use two old PCs for DOS and Win16 gaming. They are respectively 15 and 21 years old and both came with floppy drives (the younger is our old family desktop, the older me and a friend dug out of his garage and cobbled into working condition with parts found in his garage (it was missing an HDD and a sound card, as I recall). I was going to contest your analysis of the typical usage of a floppy disk for anyone still using them, but on thinking about it found it to be fairly accurate (though on both machines I'm mostly pulling in new files over the network now that I have a USB wireless dongle on the newer one, and a powerline ethernet adapter for the older one. I do use boot floppies on the older one still if I'm installing an OS on it, as it can't boot from CD). However, there is one element in the remaining use of floppies that I don't think your caching idea accounts for. My general procedure in writing a floppy for use on the older machine goes like this:

1) Boot linux on the newer of the ancient machines.
2) Transfer the image for the floppy from my modern desktop to that machine by serial (before I had it networked), or by sftp (now).
3) dd the image to /dev/fd0.
4) Mount /dev/fd0 and check to make sure that the media took the image.
5) Unmount the floppy and boot it on the older machine.

Your caching idea could mask badly written disks when the user does step 4).
Post Reply