Re: Kernel progress

Jean-Baptiste Boric <[email protected]> Sat, 14 Feb 2015 21:01:28 +0100
Newsgroups gmane.os.netbsd.ports.playstation2
Message-ID <CAH69AicLucEb6N=gx0E9n0pqDYC6to71qdWAo1-tx2Nu+vVH9w@mail.gmail.com>
--001a11433b52cb7fca050f11d2af
Content-Type: text/plain; charset=UTF-8

Yet more updates :

I got NetBSD booting up to being prompted for a root device (log from the
serial port) :

[...]
Jump to kernel!
kernel_text=0x80100000 edata=0x802ebe10 end=0x802fb0f0
phys segment: 0x1eff000 @ 0x100000
adding 0x1d03000 @ 0x2fc000 to freelist 0
pmap_steal_memory: seg 0: 0x2fc 0x2fc 0x1ffe 0x1ffe
pmap_steal_memory: seg 0: 0x31b 0x31b 0x1ffe 0x1ffe
pmap_steal_memory: seg 0: 0x31d 0x31d 0x1ffe 0x1ffe
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.4 (RAMDISK) #50: Thu Feb 12 19:26:12 CET 2015
        [email protected]:
/home/boricj/obj.playstation2/sys/arch/playstation2/compile/RAMDISK
total memory = 32768 KB
avail memory = 28956 KB
mainbus0 (root)cpu0 at mainbus0 addr 0xffffffff: Toshiba R5900 CPU (0x2e20)
Rev. 2.0 with software emulated floating point
cpu0: 48 TLB entries, 16MB max page size
cpu0: 16KB/64B 2-way set-associative L1 instruction cache
cpu0: 8KB/64B 2-way set-associative write-back L1 data cache
rn_init: radix functions require max_keylen be set
root on md0a dumps on md0b
Supported file systems: procfs null msdos mfs ffs cd9660
no file system for md0 (dev 0x600)
cannot mount root, error = 79
root device (default md0a):

More importantly, I found out that GXemul can emulate the PlayStation 2.
Although it doesn't emulate much beyond the Emotion Engine, COP0, a
framebuffer and a bunch of timers/interrupts, it can handle the NetBSD
kernel. I added basic serial port support to GXemul to see the logs, and I
could use DDB from within the emulator (no working interrupts means a panic
is needed to drop into DDB). It reached the root device prompt too.

Now the bad news : it seems that GXemul is a dead project, so I have
nowhere to put the patch beyond GitHub (https://github.com/boricj/gxemul,
branch playstation2). Also, I don't think I'm going to be able to make much
more progress on my own, as I basically still don't know what I'm doing
(newbie and kernel porting is a poor match). I don't think I'm going to
make interrupts work without studying the kernel (and the hardware)
in-depth first.

--001a11433b52cb7fca050f11d2af
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Yet more updates :<br><br>I got NetBSD booting up to =
being prompted for a root device (log from the serial port) :<br><br>[...]<=
br>Jump to kernel!<br>kernel_text=3D0x80100000 edata=3D0x802ebe10 end=3D0x8=
02fb0f0<br>phys segment: 0x1eff000 @ 0x100000<br>adding 0x1d03000 @ 0x2fc00=
0 to freelist 0<br>pmap_steal_memory: seg 0: 0x2fc 0x2fc 0x1ffe 0x1ffe<br>p=
map_steal_memory: seg 0: 0x31b 0x31b 0x1ffe 0x1ffe<br>pmap_steal_memory: se=
g 0: 0x31d 0x31d 0x1ffe 0x1ffe<br>Copyright (c) 1996, 1997, 1998, 1999, 200=
0, 2001, 2002, 2003, 2004, 2005,<br>=C2=A0 =C2=A0 2006, 2007, 2008, 2009, 2=
010, 2011, 2012, 2013, 2014, 2015<br>=C2=A0 =C2=A0 The NetBSD Foundation, I=
nc.=C2=A0 All rights reserved.<br>Copyright (c) 1982, 1986, 1989, 1991, 199=
3<br>=C2=A0 =C2=A0 The Regents of the University of California.=C2=A0 All r=
ights reserved.<br><br>NetBSD 7.99.4 (RAMDISK) #50: Thu Feb 12 19:26:12 CET=
 2015<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 [email protected]:/home/boricj=
/obj.playstation2/sys/arch/playstation2/compile/RAMDISK<br>total memory =3D=
 32768 KB<br>avail memory =3D 28956 KB<br>mainbus0 (root)cpu0 at mainbus0 a=
ddr 0xffffffff: Toshiba R5900 CPU (0x2e20) Rev. 2.0 with software emulated =
floating point<br>cpu0: 48 TLB entries, 16MB max page size<br>cpu0: 16KB/64=
B 2-way set-associative L1 instruction cache<br>cpu0: 8KB/64B 2-way set-ass=
ociative write-back L1 data cache<br>rn_init: radix functions require max_k=
eylen be set<br>root on md0a dumps on md0b<br>Supported file systems: procf=
s null msdos mfs ffs cd9660<br>no file system for md0 (dev 0x600)<br>cannot=
 mount root, error =3D 79<br>root device (default md0a):<br><br>More import=
antly, I found out that GXemul can emulate the PlayStation 2. Although it d=
oesn&#39;t emulate much beyond the Emotion Engine, COP0, a framebuffer and =
a bunch of timers/interrupts, it can handle the NetBSD kernel. I added basi=
c serial port support to GXemul to see the logs, and I could use DDB from w=
ithin the emulator (no working interrupts means a panic is needed to drop i=
nto DDB). It reached the root device prompt too.<br><br>Now the bad news : =
it seems that GXemul is a dead project, so I have nowhere to put the patch =
beyond GitHub (<a href=3D"https://github.com/boricj/gxemul">https://github.=
com/boricj/gxemul</a>, branch playstation2). Also, I don&#39;t think I&#39;=
m going to be able to make much more progress on my own, as I basically sti=
ll don&#39;t know what I&#39;m doing (newbie and kernel porting is a poor m=
atch). I don&#39;t think I&#39;m going to make interrupts work without stud=
ying the kernel (and the hardware) in-depth first.<br></div></div>

--001a11433b52cb7fca050f11d2af--