All of lore.kernel.org
 help / color / mirror / Atom feed
* Replacing the Console driver
@ 2001-07-25 21:32 John D. Davis
  2001-07-25 22:10 ` Phil Hopely
  2001-07-26  7:39 ` Geert Uytterhoeven
  0 siblings, 2 replies; 9+ messages in thread
From: John D. Davis @ 2001-07-25 21:32 UTC (permalink / raw)
  To: Debian MIPS list, SGI MIPS list

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-25 21:32 Replacing the Console driver John D. Davis
@ 2001-07-25 22:10 ` Phil Hopely
  2001-07-25 23:12   ` William Jhun
  2001-07-26  7:39 ` Geert Uytterhoeven
  1 sibling, 1 reply; 9+ messages in thread
From: Phil Hopely @ 2001-07-25 22:10 UTC (permalink / raw)
  To: John D. Davis; +Cc: Debian MIPS list, SGI MIPS list


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:

> 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
>
> --
> To UNSUBSCRIBE, email to debian-mips-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-25 22:10 ` Phil Hopely
@ 2001-07-25 23:12   ` William Jhun
  2001-07-25 23:45     ` Phil Hopely
  0 siblings, 1 reply; 9+ messages in thread
From: William Jhun @ 2001-07-25 23:12 UTC (permalink / raw)
  To: Phil Hopely; +Cc: John D. Davis, Debian MIPS list, SGI MIPS list

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

On Wed, 25 Jul 2001, Phil Hopely wrote:

> 
> 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:
> 
> > 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
> >
> > --
> > To UNSUBSCRIBE, email to debian-mips-request@lists.debian.org
> > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-25 23:12   ` William Jhun
@ 2001-07-25 23:45     ` Phil Hopely
  0 siblings, 0 replies; 9+ messages in thread
From: Phil Hopely @ 2001-07-25 23:45 UTC (permalink / raw)
  To: William Jhun; +Cc: John D. Davis, Debian MIPS list, SGI MIPS list

William Jhun wrote:

> 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
>

:)  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


>
> On Wed, 25 Jul 2001, Phil Hopely wrote:
>
> >
> > 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:
> >
> > > 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
> > >
> > > --
> > > To UNSUBSCRIBE, email to debian-mips-request@lists.debian.org
> > > with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> >

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
@ 2001-07-26  0:20   ` Alan Cox
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Cox @ 2001-07-26  0:20 UTC (permalink / raw)
  To: Phil Hopely; +Cc: William Jhun, John D. Davis, Debian MIPS list, SGI MIPS list

> 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?..

Early macintosh doesn't have an MMU as standard, The MacII had an optional
MMU (for running A/UX) and it became standard on the later Mac systems.

Alan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
@ 2001-07-26  0:20   ` Alan Cox
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Cox @ 2001-07-26  0:20 UTC (permalink / raw)
  To: Phil Hopely; +Cc: William Jhun, John D. Davis, Debian MIPS list, SGI MIPS list

> 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?..

Early macintosh doesn't have an MMU as standard, The MacII had an optional
MMU (for running A/UX) and it became standard on the later Mac systems.

Alan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-26  0:20   ` Alan Cox
  (?)
@ 2001-07-26  1:32   ` Ralf Baechle
  2001-07-26  1:51     ` William Jhun
  -1 siblings, 1 reply; 9+ messages in thread
From: Ralf Baechle @ 2001-07-26  1:32 UTC (permalink / raw)
  To: Alan Cox
  Cc: Phil Hopely, William Jhun, John D. Davis, Debian MIPS list,
	SGI MIPS list

On Thu, Jul 26, 2001 at 01:20:19AM +0100, Alan Cox wrote:

> > 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?..
> 
> Early macintosh doesn't have an MMU as standard, The MacII had an optional
> MMU (for running A/UX) and it became standard on the later Mac systems.

MC68851?

  Ralf

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-26  1:32   ` Ralf Baechle
@ 2001-07-26  1:51     ` William Jhun
  0 siblings, 0 replies; 9+ messages in thread
From: William Jhun @ 2001-07-26  1:51 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: Alan Cox, Phil Hopely, John D. Davis, Debian MIPS list,
	SGI MIPS list

On Thu, 26 Jul 2001, Ralf Baechle wrote:

> On Thu, Jul 26, 2001 at 01:20:19AM +0100, Alan Cox wrote:
> 
> > > 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?..
> > 
> > Early macintosh doesn't have an MMU as standard, The MacII had an optional
> > MMU (for running A/UX) and it became standard on the later Mac systems.
> 
> MC68851?

Yeah, but most home computers based on M68k didn't contain these (and they
probably weren't that cheap). The 68030 had it built in (except the
68EC030). Most of the 68k home computer OSes, like AmigaDOS (and probably
MacOS and Atari ST too) didn't come built with support for an MMU, so even
if you had one, it would only be useful for either running some UNIX
variant or advanced debugging tools (Amiga users remember good 'ol
Enforcer?).

Anyway, like I said, if anyone sees software emulation routines for a
somewhat modern MMU, I'd be interested. I'm sure it's been done (though
I'd like to see some routines that make use of the native MMU via some
kernel interface). It might be slow but it'd make for a killer
general-purpose debugging system. Or gobs of geeky fun.

Will


> 
>   Ralf
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Replacing the Console driver
  2001-07-25 21:32 Replacing the Console driver John D. Davis
  2001-07-25 22:10 ` Phil Hopely
@ 2001-07-26  7:39 ` Geert Uytterhoeven
  1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2001-07-26  7:39 UTC (permalink / raw)
  To: John D. Davis; +Cc: Debian MIPS list, SGI MIPS list

On Wed, 25 Jul 2001, John D. Davis wrote:
> 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.

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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-07-26  7:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-25 21:32 Replacing the Console driver John D. Davis
2001-07-25 22:10 ` Phil Hopely
2001-07-25 23:12   ` William Jhun
2001-07-25 23:45     ` Phil Hopely
2001-07-26  7:39 ` Geert Uytterhoeven
     [not found] <no.id>
2001-07-26  0:20 ` Alan Cox
2001-07-26  0:20   ` Alan Cox
2001-07-26  1:32   ` Ralf Baechle
2001-07-26  1:51     ` William Jhun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.