Hi!

I'm still working on my framebuffer driver for the Xbox.

Now I know that I just have to map 4MB of memory and access it, but I don't 
know how to implement this in a good way.


A few lines from my driver (that doesn't show anything on the the until now):

struct xboxfb_softc {
        struct device sc_dev;
        bus_space_tag_t tag;
        bus_space_handle_t handle;
};


void xboxfb_attach(struct device * parent, struct device * self, void * aux) {
        struct xboxfb_softc *sc = (struct xboxfb_softc *) self;
        struct pci_attach_args *pa = aux;
        int ret;

        sc->tag = pa->pa_memt;
        ret = bus_space_map(sc->tag, XBOX_RAM_SIZE - XBOX_FB_SIZE, 
XBOX_FB_SIZE, 2, &sc->handle);

      for (i = 0; i < 10000; i++)
              bus_space_write_4(sc->tag,sc->handle,i,XBOX_FB_BLUE);

}

What do I have to pass to bus_space_map as 4th argument? According to the 
manpage, BUS_SPACE_MAP_LINEAR would be right, but that doesn't seem to exist 
on i386. I tried the value 2 (this is the value on other architectures).


Do I have to take pa_memt or pa_iot (as a tag from the bus) ?


How large is the memory area of a "handle"?

Does bus_space_vaddr exist on i386? According to the manpage, this could be 
useful for me.


A part of my kernel config:
xboxfb0         at pci? dev ? function ?
wsdisplay*      at xboxfb? console ?

This is from NetBSD.



Best Regards,

Markus

Reply via email to