9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] realemu
@ 2011-03-02  0:22 cinap_lenrek
  2011-03-02  0:30 ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  0:22 UTC (permalink / raw)
  To: 9fans

completed realmode emulator that is to be used with aux/vga -m vesa ...
to enable the graphics card thru vesa bios in an attempt to make 8i
work (thanks russ ;-)).

tarball can be found in /n/sources/contrib/cinap_lenrek/realemu.tgz

needs the patch /n/sources/patch/vesa-softscreen-resize applied as the
vgavesa driver has to go thru the emulated /dev/realmode instead of
the short path by calling realmode() directly.

more details are in the notes file.

there is a incomplete list of graphics cards this was tested on in the
vgalist file included in the tarball.  (have like 5 working pci graphics
cards here that i'm too lazy to hookup again to get the vid/did numbers)

you might hit unimplemented instructions or code spinning in endless
loops due to lack of proper system port emulation (i just return 0 on IN[BWL]
instructions for restricted ports right now).

--
cinap




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

* Re: [9fans] realemu
  2011-03-02  0:22 [9fans] realemu cinap_lenrek
@ 2011-03-02  0:30 ` erik quanstrom
  2011-03-02  0:49   ` Gorka Guardiola
                     ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  0:30 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 19:23:42 EST 2011, cinap_lenrek@gmx.de wrote:
> completed realmode emulator that is to be used with aux/vga -m vesa ...
> to enable the graphics card thru vesa bios in an attempt to make 8i
> work (thanks russ ;-)).
>
> tarball can be found in /n/sources/contrib/cinap_lenrek/realemu.tgz
>
> needs the patch /n/sources/patch/vesa-softscreen-resize applied as the
> vgavesa driver has to go thru the emulated /dev/realmode instead of
> the short path by calling realmode() directly.
>
> more details are in the notes file.
>
> there is a incomplete list of graphics cards this was tested on in the
> vgalist file included in the tarball.  (have like 5 working pci graphics
> cards here that i'm too lazy to hookup again to get the vid/did numbers)
>
> you might hit unimplemented instructions or code spinning in endless
> loops due to lack of proper system port emulation (i just return 0 on IN[BWL]
> instructions for restricted ports right now).

i'm sorry i've forgotten.  what's the problem with unemulated vesa?

- erik



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

* Re: [9fans] realemu
  2011-03-02  0:30 ` erik quanstrom
@ 2011-03-02  0:49   ` Gorka Guardiola
  2011-03-02  0:58     ` erik quanstrom
  2011-03-02  1:06   ` cinap_lenrek
  2011-03-02  1:17   ` [9fans] realemu cinap_lenrek
  2 siblings, 1 reply; 18+ messages in thread
From: Gorka Guardiola @ 2011-03-02  0:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> i'm sorry i've forgotten.  what's the problem with unemulated vesa?
> 
Going back and forth to 16 bits does not make thing faster exactly. It will be
even more fun in 64bits. 16-32-64...


G.




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

* Re: [9fans] realemu
  2011-03-02  0:49   ` Gorka Guardiola
@ 2011-03-02  0:58     ` erik quanstrom
  2011-03-02  1:08       ` cinap_lenrek
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  0:58 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 19:49:36 EST 2011, paurea@gmail.com wrote:
> > i'm sorry i've forgotten.  what's the problem with unemulated vesa?
> >
> Going back and forth to 16 bits does not make thing faster exactly. It will be
> even more fun in 64bits. 16-32-64...

is that an issue?  the only time that vesa bios is explicitly
called is during setup of the frame buffer, and for other
rare events like blanking the screen.

- erik



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

* Re: [9fans] realemu
  2011-03-02  0:30 ` erik quanstrom
  2011-03-02  0:49   ` Gorka Guardiola
@ 2011-03-02  1:06   ` cinap_lenrek
  2011-03-02  1:16     ` erik quanstrom
  2011-03-02  1:17   ` [9fans] realemu cinap_lenrek
  2 siblings, 1 reply; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  1:06 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

the real realmode is shoot and pray. it might just crash the machine
or do wired things like reenable interrupts or even try to switch
itself to protected mode.

with realemu, you might get a messed up screen, but plan9 is still
running.  in case the vesa bios did wired stuff that caused plan9 to
crash before, it might now work with realemu.

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 3890 bytes --]

From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] realemu
Date: Tue, 1 Mar 2011 19:30:05 -0500
Message-ID: <35a1bf3e40be73448a06094f4fdb169a@ladd.quanstro.net>

On Tue Mar  1 19:23:42 EST 2011, cinap_lenrek@gmx.de wrote:
> completed realmode emulator that is to be used with aux/vga -m vesa ...
> to enable the graphics card thru vesa bios in an attempt to make 8i
> work (thanks russ ;-)).
>
> tarball can be found in /n/sources/contrib/cinap_lenrek/realemu.tgz
>
> needs the patch /n/sources/patch/vesa-softscreen-resize applied as the
> vgavesa driver has to go thru the emulated /dev/realmode instead of
> the short path by calling realmode() directly.
>
> more details are in the notes file.
>
> there is a incomplete list of graphics cards this was tested on in the
> vgalist file included in the tarball.  (have like 5 working pci graphics
> cards here that i'm too lazy to hookup again to get the vid/did numbers)
>
> you might hit unimplemented instructions or code spinning in endless
> loops due to lack of proper system port emulation (i just return 0 on IN[BWL]
> instructions for restricted ports right now).

i'm sorry i've forgotten.  what's the problem with unemulated vesa?

- erik

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

* Re: [9fans] realemu
  2011-03-02  0:58     ` erik quanstrom
@ 2011-03-02  1:08       ` cinap_lenrek
  0 siblings, 0 replies; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  1:08 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 57 bytes --]

no, speed was never a concern for realemu.

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 2516 bytes --]

From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] realemu
Date: Tue, 1 Mar 2011 19:58:45 -0500
Message-ID: <cf3d1dd11e4d7e04d765c02bf1163de6@brasstown.quanstro.net>

On Tue Mar  1 19:49:36 EST 2011, paurea@gmail.com wrote:
> > i'm sorry i've forgotten.  what's the problem with unemulated vesa?
> >
> Going back and forth to 16 bits does not make thing faster exactly. It will be
> even more fun in 64bits. 16-32-64...

is that an issue?  the only time that vesa bios is explicitly
called is during setup of the frame buffer, and for other
rare events like blanking the screen.

- erik

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

* Re: [9fans] realemu
  2011-03-02  1:06   ` cinap_lenrek
@ 2011-03-02  1:16     ` erik quanstrom
  2011-03-02  1:35       ` cinap_lenrek
  2011-03-02  1:43       ` cinap_lenrek
  0 siblings, 2 replies; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  1:16 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 20:07:19 EST 2011, cinap_lenrek@gmx.de wrote:

> the real realmode is shoot and pray. it might just crash the machine
> or do wired things like reenable interrupts or even try to switch
> itself to protected mode.
>
> with realemu, you might get a messed up screen, but plan9 is still
> running.  in case the vesa bios did wired stuff that caused plan9 to
> crash before, it might now work with realemu.

have you caught any bioses reenabling interrupts or doing other things
like that?

what's the strategy for detecting vesa bios "doing bad things"?

is the included list of video cards a list of cards that do not work with
the regular realmode but do work with emulated real mode?

- erik



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

* Re: [9fans] realemu
  2011-03-02  0:30 ` erik quanstrom
  2011-03-02  0:49   ` Gorka Guardiola
  2011-03-02  1:06   ` cinap_lenrek
@ 2011-03-02  1:17   ` cinap_lenrek
  2011-03-02  1:18     ` erik quanstrom
  2 siblings, 1 reply; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  1:17 UTC (permalink / raw)
  To: 9fans

you can also use it as a reverse engineering tool for
writing graphics drivers :)

--
cinap




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

* Re: [9fans] realemu
  2011-03-02  1:17   ` [9fans] realemu cinap_lenrek
@ 2011-03-02  1:18     ` erik quanstrom
  0 siblings, 0 replies; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  1:18 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 20:18:04 EST 2011, cinap_lenrek@gmx.de wrote:
> you can also use it as a reverse engineering tool for
> writing graphics drivers :)

that could be a very interesting applicaiton.

- erik



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

* Re: [9fans] realemu
  2011-03-02  1:16     ` erik quanstrom
@ 2011-03-02  1:35       ` cinap_lenrek
  2011-03-02  1:40         ` erik quanstrom
  2011-03-02  1:52         ` ron minnich
  2011-03-02  1:43       ` cinap_lenrek
  1 sibling, 2 replies; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  1:35 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

yes, i had one that did this as its first thing then chained into some
other bios call.

i have to look... i might still have the trace log.

i do no attempt in detecting bad stuff.  its perfectly valid to enable
interrupts in the emulator...  there are no interrupts in the virtual
machine right now (might change if i implement pit timer).

the list is just the stuff that was tested with the emulation
and worked enableing video.

might be a good idea to add "aggressive" bios behaviour in the
description.

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 2698 bytes --]

From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] realemu
Date: Tue, 1 Mar 2011 20:16:25 -0500
Message-ID: <c90065aa10d96ec87012d17cc1d47174@brasstown.quanstro.net>

On Tue Mar  1 20:07:19 EST 2011, cinap_lenrek@gmx.de wrote:

> the real realmode is shoot and pray. it might just crash the machine
> or do wired things like reenable interrupts or even try to switch
> itself to protected mode.
>
> with realemu, you might get a messed up screen, but plan9 is still
> running.  in case the vesa bios did wired stuff that caused plan9 to
> crash before, it might now work with realemu.

have you caught any bioses reenabling interrupts or doing other things
like that?

what's the strategy for detecting vesa bios "doing bad things"?

is the included list of video cards a list of cards that do not work with
the regular realmode but do work with emulated real mode?

- erik

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

* Re: [9fans] realemu
  2011-03-02  1:35       ` cinap_lenrek
@ 2011-03-02  1:40         ` erik quanstrom
  2011-03-02  1:52         ` ron minnich
  1 sibling, 0 replies; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  1:40 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 20:36:48 EST 2011, cinap_lenrek@gmx.de wrote:

> yes, i had one that did this as its first thing then chained into some
> other bios call.
>
> i have to look... i might still have the trace log.
>
> i do no attempt in detecting bad stuff.  its perfectly valid to enable
> interrupts in the emulator...  there are no interrupts in the virtual
> machine right now (might change if i implement pit timer).
>
> the list is just the stuff that was tested with the emulation
> and worked enableing video.
>
> might be a good idea to add "aggressive" bios behaviour in the
> description.

ah, i see.  i suppose i ment then to ask the question the other way
around.  what actions in the emulator are translated into real
action on the hardware?

- erik



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

* Re: [9fans] realemu
  2011-03-02  1:16     ` erik quanstrom
  2011-03-02  1:35       ` cinap_lenrek
@ 2011-03-02  1:43       ` cinap_lenrek
  2011-03-02  1:47         ` erik quanstrom
  2011-03-06  5:39         ` [9fans] rc and pmake yard-ape
  1 sibling, 2 replies; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  1:43 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

this is from Fish-'s NSC Geode GX2:

000000 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fffa 0000 0000 0000 c000 cszopdi 00a8 cd INT $6d
000000 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fff4 0000 0000 0000 c000 cszopdi 00e5 fb STI
000001 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fff4 0000 0000 0000 c000 cszopdI 00e6 fc CLD
... (some gillion zillion more lines here)

i have more traces like this from other cards, but i didnt put a reference to what
card it was in the filename :-/

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 2698 bytes --]

From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] realemu
Date: Tue, 1 Mar 2011 20:16:25 -0500
Message-ID: <c90065aa10d96ec87012d17cc1d47174@brasstown.quanstro.net>

On Tue Mar  1 20:07:19 EST 2011, cinap_lenrek@gmx.de wrote:

> the real realmode is shoot and pray. it might just crash the machine
> or do wired things like reenable interrupts or even try to switch
> itself to protected mode.
>
> with realemu, you might get a messed up screen, but plan9 is still
> running.  in case the vesa bios did wired stuff that caused plan9 to
> crash before, it might now work with realemu.

have you caught any bioses reenabling interrupts or doing other things
like that?

what's the strategy for detecting vesa bios "doing bad things"?

is the included list of video cards a list of cards that do not work with
the regular realmode but do work with emulated real mode?

- erik

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

* Re: [9fans] realemu
  2011-03-02  1:43       ` cinap_lenrek
@ 2011-03-02  1:47         ` erik quanstrom
  2011-03-06  5:39         ` [9fans] rc and pmake yard-ape
  1 sibling, 0 replies; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  1:47 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 20:44:40 EST 2011, cinap_lenrek@gmx.de wrote:

> this is from Fish-'s NSC Geode GX2:
>
> 000000 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fffa 0000 0000 0000 c000 cszopdi 00a8 cd INT $6d
> 000000 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fff4 0000 0000 0000 c000 cszopdi 00e5 fb STI
> 000001 00004f00 00000000 00000000 00000000 00009000 00000000 00000000 0000fff4 0000 0000 0000 c000 cszopdI 00e6 fc CLD
> ... (some gillion zillion more lines here)
>
> i have more traces like this from other cards, but i didnt put a reference to what
> card it was in the filename :-/

that's very eye opening.  i haven't seen any vesa trouble
since the interrupts were really turned off when calling vesa.
i suppose that i've just been lucky.

- erik



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

* Re: [9fans] realemu
  2011-03-02  1:35       ` cinap_lenrek
  2011-03-02  1:40         ` erik quanstrom
@ 2011-03-02  1:52         ` ron minnich
  2011-03-02  3:08           ` Venkatesh Srinivas
  1 sibling, 1 reply; 18+ messages in thread
From: ron minnich @ 2011-03-02  1:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

in coreboot we went with an emulator instead of dropping to 16-bit and
running the bios. We did run 16-bit code directory for a few years (I
wrote that bit), but it's just too dangerous to trust a vga bios. I
think if a BIOS has to support VGA bios with an emulator then an OS
should do the same. We caught VGA BIOS'es doing very bad things all
the time ...

I think this is really great work, cinap.

ron



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

* Re: [9fans] realemu
  2011-03-02  1:52         ` ron minnich
@ 2011-03-02  3:08           ` Venkatesh Srinivas
  2011-03-02  3:31             ` erik quanstrom
  0 siblings, 1 reply; 18+ messages in thread
From: Venkatesh Srinivas @ 2011-03-02  3:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

Don't forget platforms != x86; an emulator would be needed on ARM (say) if a
PC-like graphics chip found its way over there. I believe X has had such a
beast (x86emu?) and used it heavily on PPCen.

-- vs

[-- Attachment #2: Type: text/html, Size: 242 bytes --]

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

* Re: [9fans] realemu
  2011-03-02  3:08           ` Venkatesh Srinivas
@ 2011-03-02  3:31             ` erik quanstrom
  2011-03-02  5:42               ` cinap_lenrek
  0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2011-03-02  3:31 UTC (permalink / raw)
  To: 9fans

On Tue Mar  1 22:10:13 EST 2011, me@acm.jhu.edu wrote:

> Don't forget platforms != x86; an emulator would be needed on ARM (say) if a
> PC-like graphics chip found its way over there. I believe X has had such a
> beast (x86emu?) and used it heavily on PPCen.

the kw openrd in fact does have a vesa-capable pci device, but it's not clear
to me that the vesa bios exists on the part as shipped with the openrd.

- erik



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

* Re: [9fans] realemu
  2011-03-02  3:31             ` erik quanstrom
@ 2011-03-02  5:42               ` cinap_lenrek
  0 siblings, 0 replies; 18+ messages in thread
From: cinap_lenrek @ 2011-03-02  5:42 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

there would have to be some more stuff to add to get it working on
non pc hardware. like setting up the virtual interrupt vector table.

we currently just get a copy of the first megabyte of physical memory
thru '#v/vgabios' or '#P/realmodemem' wich contains the real ivt of
the host pc that was prepared by the system bios on bootup.

ron probably knows how todo this :-)

--
cinap

[-- Attachment #2: Type: message/rfc822, Size: 3467 bytes --]

From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] realemu
Date: Tue, 1 Mar 2011 22:31:01 -0500
Message-ID: <be3ee7e7f88aef3bffd7b38adebed221@ladd.quanstro.net>

On Tue Mar  1 22:10:13 EST 2011, me@acm.jhu.edu wrote:

> Don't forget platforms != x86; an emulator would be needed on ARM (say) if a
> PC-like graphics chip found its way over there. I believe X has had such a
> beast (x86emu?) and used it heavily on PPCen.

the kw openrd in fact does have a vesa-capable pci device, but it's not clear
to me that the vesa bios exists on the part as shipped with the openrd.

- erik

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

* [9fans] rc and pmake
  2011-03-02  1:43       ` cinap_lenrek
  2011-03-02  1:47         ` erik quanstrom
@ 2011-03-06  5:39         ` yard-ape
  1 sibling, 0 replies; 18+ messages in thread
From: yard-ape @ 2011-03-06  5:39 UTC (permalink / raw)
  To: 9fans

Anyone experienced definining pmake's ".SHELL" target as rc (the standalone)?  Mine keeps exiting at every non-zero return status.  And I'm getting tired of reading the pmake manuals (well written as they are).

This is on FreeBSD 8.1.

-Derek



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

end of thread, other threads:[~2011-03-06  5:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02  0:22 [9fans] realemu cinap_lenrek
2011-03-02  0:30 ` erik quanstrom
2011-03-02  0:49   ` Gorka Guardiola
2011-03-02  0:58     ` erik quanstrom
2011-03-02  1:08       ` cinap_lenrek
2011-03-02  1:06   ` cinap_lenrek
2011-03-02  1:16     ` erik quanstrom
2011-03-02  1:35       ` cinap_lenrek
2011-03-02  1:40         ` erik quanstrom
2011-03-02  1:52         ` ron minnich
2011-03-02  3:08           ` Venkatesh Srinivas
2011-03-02  3:31             ` erik quanstrom
2011-03-02  5:42               ` cinap_lenrek
2011-03-02  1:43       ` cinap_lenrek
2011-03-02  1:47         ` erik quanstrom
2011-03-06  5:39         ` [9fans] rc and pmake yard-ape
2011-03-02  1:17   ` [9fans] realemu cinap_lenrek
2011-03-02  1:18     ` erik quanstrom

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