public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: Jody Bruchon <jody@jodybruchon.com>
To: "ELKS (linux-8086)" <linux-8086@vger.kernel.org>
Subject: Re: Some words of encouragement
Date: Fri, 24 Feb 2012 13:22:36 -0500	[thread overview]
Message-ID: <4F47D56C.9010509@jodybruchon.com> (raw)
In-Reply-To: <CAGc3vb0t9fR+8i-MN=ieerwT2WERDQH9WYdsYbLOR=yMLsr4qw@mail.gmail.com>

On 02/24/12 12:26, Brad Normand wrote:
> I've been watching this list for a while and I'm happy development is
> continuing!  The last time I tried playing around with ELKS, I
> couldn't even get things to compile, and had I succeeded, I got the
> feeling I wouldn't be too impressed.
You probably still won't be impressed. ELKS in my QEMU frequently goes 
into an endless loop or otherwise stops working properly. I'll work out 
the problem eventually, but in the meantime I'm trying to clean up the 
code. ELKS really needs to be more comment-heavy in the code. I'm tired 
of seeing one-letter variables everywhere and not being fully sure what 
they're up to.
> In case anyone's interested, my wishlist:
>
> Support for 100% BIOS I/O (eventually I'd like to run this on
> non-standard hardware, Sanyo MBC-55x, so any in/out opcode and
> interrupt hooking will fail to work as intended).  Where necessary,
> BIOS RAM can be probed and this shouldn't be a big problem.
I think there's some degree of this already. I know ELKS can be built to 
not disable IRQs at boot, and uses BIOS calls for most disk I/O anyway.
> Support for reserving some low memory area (again due to hardware constraints).
That shouldn't be hard.
> Some method to transfer data to/from FAT12.
Planned for the future, for sure. The FAT filesystem options in ELKS 
were "unimplemented features" so I stripped them out of the build 
process entirely until a driver actually exists.
> And, a question... how feasible would it be to run anything with 256KB
> RAM?  I was tempted to reply to the EMS code message because to make a
> useful ELKS machine out of these, I may have to design a memory
> expansion board, and I've got lots of 4MB SIMMs laying around.
> Otherwise without kernel bankswitching support (or through EMS calls)
> I believe I can do 960KB.
The problem with EMS code is that ALL EMS boards are different, and the 
LIM EMS specification is useless since it relies on the vendor-supplied 
DOS driver to work. We can write an EMS driver if we have the hardware 
and can figure out how it works, or if you make the hardware yourself as 
you suggest. EMS is extremely hard to find (particularly at a sane 
price) these days so I blew the whole idea off.
> I also have a strange memory management idea that may be
> interesting...  Since 8086 is a 64KB segment oriented machine and you
> are already bumping up against the limitations of that, and there is
> talk of changing compilers...  how crazy would it be to design a new
> segmentation ABI to allow relocation of segments and still allow
> programs to use more than 64KB?
Manpower is always the issue. My thoughts (which I have not shared until 
now) were the same as what I was doing with my 6502 operating system 
that I've written: each program has a set of relocation tables that are 
just a list of offsets to absolute pointers (far pointers on 8086, long 
addresses on other platforms we might support later like 65816) and when 
the application image is loaded into memory, the relocation tables are 
retained in memory as well. If we needed to shuffle code elsewhere in 
memory for whatever reason (EMS, swap, defragmenting memory, loading a 
distinctly separate instance of a program already being executed, 
something to do while setting the building on fire) it would be a simple 
matter of enhancing the memory manager to intelligently rewrite 
relocations and tweak the stored task processor context to match the 
changes. This could even potentially be used to move data that is 
malloc()ed around if it was done carefully. But, of course, we come back 
to the issue of manpower once more. Who is going to write the compiler 
code that generates these new executables, the ELKS code that handles 
the new executable format, etc.? From what I understand, a lot of the 
people with sufficient compiler knowledge bailed on ELKS some time ago, 
so making this change would be an uphill battle.
> I'm thinking something along the lines of, instead of using mov DS,AX
> type instructions, these are changed to an OS call, so that the kernel
> knows what segments the userspace is using, and when it has to
> relocate data, it can simply rewrite the stored CS,DS,ES,SS of the
> userspace, and next time the userspace needs to switch segments, it
> asks the OS to do the dirty work.  Managing>64KB allocations is
> possible too but basically the program needs to request a 64KB window
> into the data at a time.  This would probably be pretty directly
> applicable to a bankswitching scheme as a poor man's MMU.
That sounds plausible, but I'm guessing bcc doesn't generate MOV DS,AX 
anyway, since it apparently restricts everything to single segments...
> Sorry for the craziness but I've spent many hours pondering this stuff
> in the past...  if there's interest I'd be happy to put together a
> specification of sorts.
Right now, we need to fix the most egregious bugs in the code, 
specifically the ones that cause the system to hang, lock up, get stuck 
at a looping "login:" or other crashy behavior. I suspect that bcc is 
partially responsible for some of these problems, given that it 
generates lackluster code and the bcc source itself is very poorly 
documented, making changes to it dicey. Once again, I would love to 
switch compilers, but while SDCC is apparently the most promising 
option, it also doesn't support the 8086 (unless I missed something when 
I looked at it), so that's a dead end unless someone wants to port SDCC 
to 8086 first. I'm thinking that the only real solution is going to be 
to either massively retool bcc, or to write a compiler. I'm starting to 
see why ELKS was abandoned; few people exist that want to do these big 
jobs AND possess the requisite experience to actually do it.

Jody Bruchon

  reply	other threads:[~2012-02-24 18:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 17:26 Some words of encouragement Brad Normand
2012-02-24 18:22 ` Jody Bruchon [this message]
2012-02-25  0:54   ` David Given
2012-02-25  6:27     ` Brad Normand
2012-02-25 12:53       ` David Given
2012-02-25 13:13         ` David Given
2012-02-25 18:04           ` Brad Normand
2012-02-25 19:09             ` David Given
2012-02-25 20:29               ` Brad Normand
2012-02-25 21:04                 ` David Given
2012-02-25 23:05                   ` Brad Normand
2012-02-26  1:10                     ` zkry
2012-02-25  5:12   ` Brad Normand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F47D56C.9010509@jodybruchon.com \
    --to=jody@jodybruchon.com \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox