Project complete: Porting OpenBSD to the Xbox

2007-07-16 Thread Markus Ritzer

Hello!

Today, I have completed my project for university: Porting OpenBSD to 
the Xbox.


Summary (from the project page):
The project is finished now (the port is not completely finished), and 
the most important parts are working. The kernel boots, memory gets 
initialized, there is output on the TV, network is working, the root fs 
gets mounted, users can log in and work with the system. But there are 
still things that could be done. I have to do other things now, and I 
don't have time anymore to continue and completely finish the port. But 
the inhibition threshold for others who want OpenBSD at the Xbox should 
be very low now, the most annoying and time wasting problems are solved. 
I hope somebody will complete the port (please let me know if you plan 
to do so).
The Xbox isn't supported as an official platform by the OpenBSD 
developers, a pity (It isn't even mentioned on plat.html).
A big thanks to the NetBSD Xbox port, I have taken some code from there, 
and to all the other people that helped me.



Details can be found at the project page:
http://tobias.schroepf.de/doku/doku.php?id=xbox:porting_openbsd_to_the_xbox


Tank your for your interest / help!



Regards,

Markus Ritzer



Re: nfe0 problem (obsd 4.1)

2007-06-28 Thread Markus Ritzer

Hi!


I've noticed that once in a while the nfe0 interface will stop
sending and receiving data.  At this point I can not make it work
again.  The only solution I have is to reboot the box.  I have
installed a dc0 card in the box since.  The problem seemed
intermittent and not reliably reproducible.
I had problems like these when I ported OpenBSD to the Xbox ( 
http://tobias.schroepf.de/doku/doku.php?id=xbox:porting_openbsd_to_the_xbox  
)


You can find the patches I have made here:
http://tobias.schroepf.de/doku/doku.php?id=xbox:patch_the_openbsd_sources_network


But  don't know if this will solve your problem.



Markus Ritzer



Announcement: OpenBSD Port to the MS Xbox

2007-04-21 Thread Markus Ritzer

Hello!

My name is Markus Ritzer and I have started a project (mainly for 
university): "Porting OpenBSD to the Xbox"


There is a homepage about the project, you can always check the current 
status there.
It is a project at university, which has to be done since September 
2007. So there will be a port since then.


My current status is: Memory management and framebuffer are running.
Next things to do: Integrate the framebuffer in a wsdisplay and mounting 
the root fs.



If you can help me, I would appreciate it a lot. If you are just 
curious, check out the web page:
https://tobias.schroepf.de/doku/doku.php?id=xbox:porting_openbsd_to_the_xbox 



You can also see pictures of the output of the booting kernel


I will also write a report and a make presentation, but this will be in 
German language.




Best Regards,

Markus Ritzer



Architecture of console/terminal drivers

2007-04-16 Thread Markus Ritzer

Hello!


I would like to write a console driver for the Xbox port of OpenBSD. I 
have a framebuffer driver that can draw pixels, characters and strings 
on the screen, but I don't know how to implement a real console driver.


I'm not even sure about the terms console, terminal, wscons, vcons.

Is a wsdisplay driver enough?
What functions do I have to implement?


A part from the kernel configuration of NetBSD:


xboxfb0 at pci? dev ? function ?   # the framebuffer
wsdisplay*  at xboxfb? console ?


and from NetBSD files.i386:

device xboxfb: wsemuldisplaydev, rasops32, vcons
attach xboxfb at pci
file  arch/i386/xbox/xboxfb.c xboxfb needs-flag


I'm not sure what functions and structs I need.

I have read the manpages wsdisplay and wscons.



Thank you in advance,

Markus



bus_space_map on i386

2007-03-31 Thread Markus Ritzer
Hello!

I would like to use bus_space_map for writing a framebuffer driver (on i386). 
I've read the manpage, which sais the 4th argument of the function is 
the "cacheable" argument. I would like to use BUS_SPACE_MAP_LINEAR. But that 
doesn't seem to be defined on i386 (it's the same with 
BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_PREFETCHABLE).
What should I pass as 4th argument?


Did I get it right that the "tag"-variable just differentiates the IO-space 
from the memory space?



Thanks in advance,

Markus



Re: Framebuffer in OpenBSD

2007-03-14 Thread Markus Ritzer
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



I386: Real Mode vs. Protected Mode

2007-02-14 Thread Markus Ritzer
Hello!

I would  like to know when the CPU is switched into protected mode on i386?

Before or after executing init386() ?
Or does the bootloader / or the BIOS do this?

Markus



Writing Device Drivers Dokumentation

2007-02-10 Thread Markus Ritzer
Hello!

I would like to write a framebuffer driver for OpenBSD (for the MS Xbox 
platform).

Where can I find documentation about writing OpenBSD drivers in general or 
especially for framebuffers?


Thanks in advance,

Markus Ritzer



Memory and pmap

2007-01-24 Thread Markus Ritzer
Hello!

I try to port OpenBSD to the Microsoft Xbox (the old one). My OpenBSD Kernel 
boots until it crashes while handling memory related things. FreeBSD, which 
is already ported, has this code:

arch_i386_is_xbox tells if it is an Xbox and
arch_i386_xbox_memsize is set to 64 oder 128, depend how much memory you have.


#ifdef XBOX
if (arch_i386_is_xbox) {
/*
 * We queried the memory size before, so chop off 4MB for
 * the framebuffer and inform the OS of this.
 */
physmap[0] = 0;
physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - 
XBOX_FB_SIZE;
physmap_idx = 0;
goto physmap_done;
}
#endif


It sets up the physmap. I looked for hours on the code of OpenBSD, but I 
cannot really find out how this is done here. The code belongs to the 
function init386() in machdep.c.

Is there an equivalent struct in OpenBSD to FreeBSD's physmap ?


Thank you in advance,

Markus Ritzer



Framebuffer in OpenBSD

2007-01-23 Thread Markus Ritzer
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.


How could I get output from the Kernel?


The Xbox has no serial port... just USB and Ethernet.



Markus Ritzer