Re: Memory issues and USB support?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 19 Mar 2017 00:02:20 -0600
Derek Johansen <djohanse678@xxxxxxxxx> wrote:

> Just out of curiosity:
> 
> 1) Why the restriction to ~640K of memory for running ELKS.  Lots of
> implementations banging up against this lately.  Can ELKS be modified
> to use all available memory (e,g, my virtual system has ~1 GB
> available; could ELKS be modified to use all of that)?

Actually applications are hitting the 64K code / 64K data limit. The
total system limit is 1MB for an 8086 but on most 8086 platforms a chunk
of that is video, MMIO and BIOS so you get 640K. Beyond that 640K you can
swap, so for a normal sane system from that era running appropriate apps
640K should be plenty of memory.

On a 286 in protected mode (which ELKS kind of supports) you should be
able to go to 16MB (again you don't get 384K of it on a PC). There is
some minimal 286 protected mode support in ELKS but only for 64K/64K
binaries.

Getting bigger user applications means teaching the compiler to generate
protected mode safe larger mode binaries. For code that's actually not
too horrible providing you understand the LDT/GDT have to be OS managed
to allow for swap and memory compaction. For data it's a lot more
exciting if you want to support objects bigger than 64Kbyte in size, and
still quite 'interesting' from a compiler perspective anyway.

On an 8086 the other option is to support EMM boards. That allows you up
to 4MB or so of which 64K at a time is visible in a fixed memory window -
that's actually ideal for ELKS but fiddly for memory management as any
application that's got split code/data and can be over 64K will need to
be arranged so only half of it lives in EMM space.

> 2)  Does ELKS support USB devices?  Will it ever?  Is it even possible?

No and USB is actually very hard for three reasons
1. There is almost no ISA USB hardware so you'll need to design your own
2. USB adds device hotplug to your system, something ELKS and older
OSs - older Linux included simply have no concept of. That's a major
rework, although you can dodge some of it with restricted functionality
3. The USB stack itself is a complicated beast needing a lot of memory

And if you are trying to do a small OS on an old 386 or later x86 platform
I'd just grab NetBSD/OpenBSD. They've not inflated in the same way Linux
(and in particular the Linux user space) has.

Alan

--
To unsubscribe from this list: send the line "unsubscribe linux-8086" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel]     [Linux ia64]     [DCCP]     [Linux for ARM]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux