Re: Framebuffer in OpenBSD
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 1; 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
Re: Framebuffer in OpenBSD
On Tue, Jan 23, 2007 at 12:07:50PM +0100, Markus Ritzer wrote: Hello! I would like to port OpenBSD to the MS Xbox (old one). The Kernel already boots until main() in kern/init_main.c . (I can control this with the front LED of the Xbox). The next thing I would like to do is to write a kind of framebuffer driver so that I can get output on the TV. I have the sourcecode for the framebuffer driver of FreeBSD and Linux, but I don't know how to integrate it in OpenBSD. I read that OpenBSD has no framebuffer at all. openbsd has a lot of framebuffers. look at arch/sparc64/dev/fb.c as a start. How could I get output from the Kernel? The Xbox has no serial port... just USB and Ethernet. Markus Ritzer -- Alexander Yurchenko
Re: Framebuffer in OpenBSD
I would like to port OpenBSD to the MS Xbox (old one). The Kernel already boots until main() in kern/init_main.c . (I can control this with the front LED of the Xbox). The next thing I would like to do is to write a kind of framebuffer driver so that I can get output on the TV. I have the sourcecode for the framebuffer driver of FreeBSD and Linux, but I don't know how to integrate it in OpenBSD. You might to have a look at NetBSD which recently got some xbox support (although I don't see the point on running on such a machine). I read that OpenBSD has no framebuffer at all. This is a overbroad generalization of ``the i386 and amd64 ports of OpenBSD run the frame buffer in text mode''. Actually, -CURRENT has code to drive the main display in graphics mode if it is VESA 2 compliant (vesafb). You might want to build on top of it as well. Miod