9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Installing without graphics ?
@ 2000-06-14 20:36 Russ Cox
  2000-06-24 19:42 ` R. J. Bradley
  0 siblings, 1 reply; 8+ messages in thread
From: Russ Cox @ 2000-06-14 20:36 UTC (permalink / raw)
  To: 9fans

  1) Is there any way to install the system without vga and rio up
  and running. I need an installed system if I am going to be able
  to play with writing a driver for my card.

You could carry out an install without
vga and rio, but only by hand.  You'll find
the system unusable in text mode for the
purposes of writing a video driver anyway.
Much better to get going on a different
video card first, so as to have a decent
development environment.

  2) Where would be the best place to look for starting to write a
  graphics driver. How much work is done by the card specific code ?

Not a lot, especially if you punt on the
hardware acceleration the first time 'round.
Mostly it's just setting up registers correctly
for the given mode.

Russ



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [9fans] Installing without graphics ?
@ 2000-06-25  2:36 Russ Cox
  0 siblings, 0 replies; 8+ messages in thread
From: Russ Cox @ 2000-06-25  2:36 UTC (permalink / raw)
  To: 9fans

  Could anyone provide a rough overview of the vga driver code in the kernal
  and aux/vga ? I have a few ideas of where to start but there are quite a
  few structs invloved whose members and purposes I can only guess at. Ive
  managed to drag the source for the TGUI9680 out of SVGAlib and XFree86
  as well as a register list so I have these as a starting point for talking
  to my card.

We don't use much of the vga special features,
so there's not as much work in getting a card
up under Plan 9 as there is under, say, XFree86.

Aux/vga is in charge of initializing the registers
on the card to get it into a given VGA mode and depth.
At that point, it hands off to the kernel,
which treats it as a frame buffer.

Internally, each driver in aux/vga (an example
might be /sys/src/cmd/aux/vga/mach64xx.c) provides
four functions snarf, init, load, and dump.
Snarf reads the registers.  Init tweaks
the in-memory copy of the registers, and then
load writes them back (only happens with -l).
Dump prints them for debugging.

There are drivers for both the card and the
graphics cursor.  When adding a driver, be sure
to add it to the list in data.c.

I like to make one pass through the manual,
mark the registers I think are important,
and then write the code.  Before the first
load, though, I try to get a dump from a Unix
system or from Windows and compare.

Once the registers are set, aux/vga hands control
to the kernel, which treats the memory as a big
frame buffer.  /sys/src/9/pc/vgamach64xx.c is a
decent example.

The kernel also has to manipulate the hardware
graphics cursor, but that's usually straightforward.

If you want to run in more than 8-bit mode, you'll
need to work on hardware acceleration to make it
bearable.  We use block copy and block clear,
and that's enough to feel quite zippy.

It's useful for debugging to have the kernel driver
set up two segments (see segattach(2)), one for
the frame buffer and one for any PCI-mapped registers.
Then you can test the acceleration from user
space and move it into the kernel once it is ready.
When you get that far, mail me and I'll send a template
I like to use to do that.

Hope that helps.
Russ


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [9fans] Installing without graphics ?
@ 2000-06-14 20:18 R. J. Bradley
  0 siblings, 0 replies; 8+ messages in thread
From: R. J. Bradley @ 2000-06-14 20:18 UTC (permalink / raw)
  To: 9fans


Hi

After finaly managing to find a floppy disk without a bad sector
(had to buy some new disks) I have booted Plan 9 and as I expected
my graphics card (Trident TGUI96xx) isnt supported.

Any help with the following would be appreciated.

1) Is there any way to install the system without vga and rio up
and running. I need an installed system if I am going to be able
to play with writing a driver for my card.

2) Where would be the best place to look for starting to write a
graphics driver. How much work is done by the card specific code ?

Thanks for any help.

Robin




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

end of thread, other threads:[~2000-06-26 19:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-14 20:36 [9fans] Installing without graphics ? Russ Cox
2000-06-24 19:42 ` R. J. Bradley
2000-06-26  4:44   ` Richard
2000-06-26 14:46   ` Xavier Bertou
2000-06-26 18:03   ` Lyndon Nerenberg
2000-06-26 19:41     ` R. J. Bradley
  -- strict thread matches above, loose matches on Subject: below --
2000-06-25  2:36 Russ Cox
2000-06-14 20:18 R. J. Bradley

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