9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] various bitsy questions
@ 2002-10-22 23:42 presotto
  0 siblings, 0 replies; 4+ messages in thread
From: presotto @ 2002-10-22 23:42 UTC (permalink / raw)
  To: 9fans

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

The way to port pcmciamodem.c it is to get rid of it completely.  On the bitsy,
a user level program open's /dev/pcm0ctl and writes a string like:

	configure #xspec arg [ index ]

into it.  The '#xspec' is a device specifier like you'ld use in bind, e.g.,
#l0.  'x's configure routine is called as:

	devtab[].config(int on, char *spec, DevConf *cp)

where 'on' == 1 means to configure and enable the card and == 0 means disable and unconfigure it.
      'spec' is the same as for bind's, for example, 0 or 1 to indicate ether 0
			or ether 1,
      'cp->mem' is where the pcmcia chip has configured the memory to be
      'cp->port' is where the pcmcia chip has mapped the io ports
      'cp->irq' is where the pcmcia chip has mapped the interrupt
      'cp->type' is the 'arg' that the user wrote

This allows us to flavor the card after the fact rather than at boot time
or to disable it so that we can pull it out.

Look at the config routine in devether.c.  The equivalent to pcmciamodem.c
is adding a config routine in port/devuart.c.

I did this model after I did the PC and like it a lot more.  It means that the
drivers don't have to know about all the different names a card can be called by
and allows us to pull cards out and insert new ones without rebooting.  Its
what I should have done in the first place.  I'm currently rewriting pc/devpccard.c
and pc/devi82365.c to be a single driver with exactly that interface.  All the
pcmciaxxxx.c files will disappear.  boot/bootip.c will configure in the card if
it needs to.

If you rewrite devuart.c to do this, I'll be happy to pick it up as soon as I
finish the pc conversion.  If not, I'll do it anyways since I want to try
our gprs card on the bitsies.  Might make them a bit more useful than the
802.11 card does or at least useful in different situations.  Of course, until
we can put the suckers to sleep and wake them up successfully, they're only
useful for a few hours at most.

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

From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: [9fans] various bitsy questions
Date: Tue, 22 Oct 2002 22:36:57 +0200
Message-ID: <200210222036.g9MKawZ12108@zamenhof.cs.utwente.nl>

Just a few questions (pointers welcome)...

What would be needed to `port' pcmciamodem.c to bitsy?
It's probably obvious, but I'm confused by irq and ioports
on the bitsy -- is there an equivalent to '#P/'*alloc to see
what's in use?

Bitsy source gives me the impression that both portrait and landscape
mode is supported. Is there a way to choose between them,
other than setting landscape in screen.c?

What do the Scrib and Menu buttons in the scribble keyboard?
Do they add `missing' window parts if scriblle started keyboard-only?

Thanks,
Axel.

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

* Re: [9fans] various bitsy questions
@ 2002-10-22 23:45 presotto
  0 siblings, 0 replies; 4+ messages in thread
From: presotto @ 2002-10-22 23:45 UTC (permalink / raw)
  To: 9fans

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

I forgot to explain [ index ].  A pcmcia card can have many configurations
in its attribute memory.  Normally we pick the default one.  However, we
can override that by passing the index of the one to use in the configure
message.  The indices are part of the configuration and don't necessarily
(in fact rarely) start at 0 or 1.

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

[-- Attachment #2.1.1: Type: text/plain, Size: 1985 bytes --]

The way to port pcmciamodem.c it is to get rid of it completely.  On the bitsy,
a user level program open's /dev/pcm0ctl and writes a string like:

	configure #xspec arg [ index ]

into it.  The '#xspec' is a device specifier like you'ld use in bind, e.g.,
#l0.  'x's configure routine is called as:

	devtab[].config(int on, char *spec, DevConf *cp)

where 'on' == 1 means to configure and enable the card and == 0 means disable and unconfigure it.
      'spec' is the same as for bind's, for example, 0 or 1 to indicate ether 0
			or ether 1,
      'cp->mem' is where the pcmcia chip has configured the memory to be
      'cp->port' is where the pcmcia chip has mapped the io ports
      'cp->irq' is where the pcmcia chip has mapped the interrupt
      'cp->type' is the 'arg' that the user wrote

This allows us to flavor the card after the fact rather than at boot time
or to disable it so that we can pull it out.

Look at the config routine in devether.c.  The equivalent to pcmciamodem.c
is adding a config routine in port/devuart.c.

I did this model after I did the PC and like it a lot more.  It means that the
drivers don't have to know about all the different names a card can be called by
and allows us to pull cards out and insert new ones without rebooting.  Its
what I should have done in the first place.  I'm currently rewriting pc/devpccard.c
and pc/devi82365.c to be a single driver with exactly that interface.  All the
pcmciaxxxx.c files will disappear.  boot/bootip.c will configure in the card if
it needs to.

If you rewrite devuart.c to do this, I'll be happy to pick it up as soon as I
finish the pc conversion.  If not, I'll do it anyways since I want to try
our gprs card on the bitsies.  Might make them a bit more useful than the
802.11 card does or at least useful in different situations.  Of course, until
we can put the suckers to sleep and wake them up successfully, they're only
useful for a few hours at most.

[-- Attachment #2.1.2: Type: message/rfc822, Size: 2939 bytes --]

From: Axel Belinfante <Axel.Belinfante@cs.utwente.nl>
To: 9fans@cse.psu.edu
Subject: [9fans] various bitsy questions
Date: Tue, 22 Oct 2002 22:36:57 +0200
Message-ID: <200210222036.g9MKawZ12108@zamenhof.cs.utwente.nl>

Just a few questions (pointers welcome)...

What would be needed to `port' pcmciamodem.c to bitsy?
It's probably obvious, but I'm confused by irq and ioports
on the bitsy -- is there an equivalent to '#P/'*alloc to see
what's in use?

Bitsy source gives me the impression that both portrait and landscape
mode is supported. Is there a way to choose between them,
other than setting landscape in screen.c?

What do the Scrib and Menu buttons in the scribble keyboard?
Do they add `missing' window parts if scriblle started keyboard-only?

Thanks,
Axel.

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

* Re: [9fans] various bitsy questions
@ 2002-10-22 22:02 Russ Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Russ Cox @ 2002-10-22 22:02 UTC (permalink / raw)
  To: 9fans

Switching at run time can't work.
The draw code isn't that smart.
Same reason you can't run aux/vga
again to resize the screen.

I actually got the resize code working
once, but it was hard to extract those
changes from other significant changes
that I didn't want to pull back in.

Russ



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

* [9fans] various bitsy questions
@ 2002-10-22 20:36 Axel Belinfante
  0 siblings, 0 replies; 4+ messages in thread
From: Axel Belinfante @ 2002-10-22 20:36 UTC (permalink / raw)
  To: 9fans

Just a few questions (pointers welcome)...

What would be needed to `port' pcmciamodem.c to bitsy?
It's probably obvious, but I'm confused by irq and ioports
on the bitsy -- is there an equivalent to '#P/'*alloc to see
what's in use?

Bitsy source gives me the impression that both portrait and landscape
mode is supported. Is there a way to choose between them,
other than setting landscape in screen.c?

What do the Scrib and Menu buttons in the scribble keyboard?
Do they add `missing' window parts if scriblle started keyboard-only?

Thanks,
Axel.


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

end of thread, other threads:[~2002-10-22 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-22 23:42 [9fans] various bitsy questions presotto
  -- strict thread matches above, loose matches on Subject: below --
2002-10-22 23:45 presotto
2002-10-22 22:02 Russ Cox
2002-10-22 20:36 Axel Belinfante

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