9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: lucio@proxima.alt.za, 9fans@9fans.net
Subject: Re: [9fans] realemu update
Date: Mon,  7 Mar 2011 12:50:29 +0100	[thread overview]
Message-ID: <8fb16d83a62dd47d262ae5f8020045db@gmx.de> (raw)
In-Reply-To: <20110307110755.GA1893@fangle.proxima.alt.za>

> On Mon, Mar 07, 2011 at 11:39:10AM +0100, cinap_lenrek@gmx.de wrote:
> > /dev/realmodemem is just an image of the first megabyte of
> > physical memory that is addressable from 16 bit realmode.
> >
> That being where the machine's BIOS resides, if memory serves.
> Plus whatever can fit in there if one chooses to use the space.
> I'll understand things better with the fesh background, thank you.

yes, exactly. it also contains the data setup by the bios.

this is the memory map from realemu main.c, one entry for each
64k block:

static Bus memio[] = {
	/* 0 */ memory, rmem, wmem,	/* RAM: IVT, BIOS data area */
	/* 1 */ memory,	rmem, wmem,	/* custom */
	/* 2 */ nil,	rbad, wbad,
	/* 3 */ nil,	rbad, wbad,
	/* 4 */ nil,	rbad, wbad,
	/* 5 */ nil,	rbad, wbad,
	/* 6 */ nil,	rbad, wbad,
	/* 7 */ nil,	rbad, wbad,
	/* 8 */ nil,	rbad, wbad,
	/* 9 */ memory,	rmem, wmem,	/* RAM: extended BIOS data area */
	/* A */ memory,	rmem, wrealmem,	/* RAM: VGA framebuffer */
	/* B */ memory,	rmem, wrealmem,	/* RAM: VGA framebuffer */
	/* C */ memory,	rmem, wbad,	/* ROM: VGA BIOS */
	/* D */ nil,	rbad, wbad,
	/* E */ memory,	rmem, wbad,	/* ROM: BIOS */
	/* F */ memory,	rmem, wbad,	/* ROM: BIOS */
};

on startup, we read in all the readable memory from the host machine.
this means, that if the host machine is not a x86 with a bios that
mapped the roms for us it will not work.  to make this work have to do
the same thing the bios on a pc makes like setting up a realmode
interrupt table and discover and map in the vga roms.

> > the write returns when the BIOS call returns and the machine
> > state can be read back from /dev/realmode.
> >
> That is a neat idea.

yeah, its the power of filesystem abstraction all over again :)

also, with realemu, you can interrupt the write to /dev/realmode in
case the code hangs in a endless loop.  otherwise it will return if
the code comes back from the interrupt call to the bios or when the
code produces some kind of exception.  errstr will be set to a string
describing the exception and the exception number will be in u->trap
when reading /dev/realmode back.

--
cinap




  reply	other threads:[~2011-03-07 11:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-05  6:49 cinap_lenrek
2011-03-06  7:35 ` Lucio De Re
2011-03-06 18:48   ` cinap_lenrek
2011-03-07  4:21     ` Lucio De Re
2011-03-07 10:39       ` cinap_lenrek
2011-03-07 11:07         ` Lucio De Re
2011-03-07 11:50           ` cinap_lenrek [this message]
2011-03-07 12:23         ` erik quanstrom
2011-03-07 12:39           ` Lucio De Re
2011-03-07 14:19           ` Russ Cox
2011-03-07 14:44             ` Lucio De Re
2011-03-07 15:03               ` Russ Cox
2011-03-08 10:45                 ` Stanley Lieber
2011-03-08 11:10                 ` Stanley Lieber
2011-03-08  7:42                   ` cinap_lenrek at gmx.de

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=8fb16d83a62dd47d262ae5f8020045db@gmx.de \
    --to=cinap_lenrek@gmx.de \
    --cc=9fans@9fans.net \
    --cc=lucio@proxima.alt.za \
    /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;
as well as URLs for NNTP newsgroup(s).