Subject: Replacing the Console driver

From: "John D. Davis" <[email-masked]>
Date: Wed, 25 Jul 2001 14:32:52 -0700 (PDT)

I am modifying the linux kernel to be able to be run by a simulator.  I
need to modify the console driver and interrupt handler.  I have been
going through the various files, console.*, tty.* and the serial files to
see how to interface to the console.  I have also read some kernel korner
articles, but they seem a little out of date.  Is there any other
recommended documentation on the console driver and how it works on an
indy? I am trying to sort out the low-level interfaces from the
higher-level ones.  I just need to change the low-level interface from
using the hardware to using the simulator interface.

thanks,
john

---

From: Phil Hopely <[email-masked]>
Date: Wed, 25 Jul 2001 15:10:52 -0700

I do not know if you have examined any of the current open source emulation
projects that exist, but I believe
you might be interested to examine www.mame.net or mess.emuverse.com?

They have a cpu core for mips emulation, I believe it may only be r3000
though?..

Also, there exist numerous open-source playstation emulators, which I believe
are r3000 based too...

The mame & mess projects are matured open-source projects that have been ported
across the universe, they're really pretty cool, this work would be a likely fit
with the mess project.

If you implement by way of pure emulation, you'd not need to change the kernel
at all?

Phil

"John D. Davis" wrote:

> --
> To UNSUBSCRIBE, email to [email-masked]
> with a subject of "unsubscribe". Trouble? Contact [email-masked]

---

From: William Jhun <[email-masked]>
Date: Wed, 25 Jul 2001 16:12:27 -0700 (PDT)

Hi Phil :o),

The only problem with pure emulation is writing a good emulator for an
MMU. I wrote a SPARC V8 instruction set emulator a year ago and stopped
around the time I had to face the fact that a direct virtual->physical
mapping would no longer be of any use. (also the semester started again
:o). Not that it's not possible, but it's difficult and would require a
mapping with every memory access (being very slow). However, a little
creative help from the kernel and some creative mmap()ing might do the job
(you can request a specific linear address with mmap()). If anyone knows
some good methods for doing this, please inform! (and I might finish that
emulator :o)

William

---

From: Phil Hopely <[email-masked]>
Date: Wed, 25 Jul 2001 16:45:28 -0700

> some good methods for doing this, please inform! (and I might finish that

:)  yep, you are right - the r3000 core in the mame sources I am perusing do not
implement an mmu
(the playstation and williams standups use "a custom r3000a by LSI Logic" - see
src/cpu/mips/mips.c - no cache mechanism either).

Poking around the mame sources (I've got xmame b13 r1 - ancient really, from sometime
late 1999 I think), it appears that the z180 cpu is the only core that has some kind
of mmu emulation.  The z8k & m68k also have mmu instructions, but those were not
emulated in this version of mame...

I haven't checked more recent versions, but I think recent mess (uses same cpu cores
as mame) supports early macs, so there may be an implementation example there?..

Phil

---

From: Geert Uytterhoeven <[email-masked]>
Date: Thu, 26 Jul 2001 09:39:05 +0200 (MEST)

> using the hardware to using the simulator interface.

The interface to the console is specified in <linux/console.h>.

So write your own console implementation, and set

    conswitchp = &consw_for_your_emulator

in early kernel initialization code.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email-masked]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds