0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PS2LinuxをB.B.Navigatorから起動させる

Last updated at Posted at 2025-02-14

本家のPS2Linuxをいじるがなくなったので急遽、保存を残します。

#akmem_ps2 PS2Linux from BBnavigator
sudo mount /mnt/mc00
sudo -s
password : XXXXXXXX
cd /mnt/mc00
cp -p akmem_ps2.tar.gz /usr/src
exit
cd /usr/src
sudo tar zxvf akmem_ps2.tar.gz
cd akmem_ps2
sudo make; make mknod; make install
sudo cp -p akload /sbin/akload

sudo mkdir /mnt/bbn
sudo mount -t reiserfs /dev/hda11 /mnt/bbn
sudo cp -p /sbin/akload /mnt/bbn/sbin
cd /usr/src
sudo mv linux linux.org
sudo ln -s linux-2.2.21-pre1-xr7 linux
cd linux
sudu -s
password(User): XXXXXXXX

viでarch/mips/このあたりのファイル(init.c)を編集する必要あり
vi init.c
ここから
/*

  • init.c
  •    Copyright (C) 2000, 2001  Sony Computer Entertainment Inc.
    
  • This file is subject to the terms and conditions of the GNU General
  • Public License Version 2. See the file "COPYING" in the main
  • directory of this archive for more details.
  • $Id: init.c,v 1.5 2002/01/15 02:18:13 nakamura Exp $
    */
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include

#define SBIOS_BASE 0x80001000
#define SBIOS_ENTRY 0
#define SBIOS_SIGNATURE 4

static struct ps2_bootinfo ps2_bootinfox;
struct ps2_bootinfo *ps2_bootinfo = &ps2_bootinfox;

char arcs_cmdline[CL_SIZE] = "root=/dev/hda1";

#ifdef CONFIG_AKMEM
#include
#include
extern void akmem_bootinfo;
extern int akmem_bootinfo_size;
#endif /
CONFIG_AKMEM */

int __init prom_init(int argc, char **argv, char **envp)
{
struct ps2_bootinfo *bootinfo;
int oldbootinfo = 0;

/* default bootinfo */
memset(&ps2_bootinfox, 0, sizeof(struct ps2_bootinfo));
ps2_bootinfox.sbios_base = SBIOS_BASE;

#ifdef CONFIG_T10000_MAXMEM
ps2_bootinfox.maxmem = 128;
#else /* CONFIG_T10000_MAXMEM /
ps2_bootinfox.maxmem = 32;
#endif /
!CONFIG_T10000_MAXMEM */
ps2_bootinfox.maxmem = ps2_bootinfox.maxmem * 1024 * 1024 - 4096;

#ifdef CONFIG_PS2_COMPAT_OLDBOOTINFO
if (*(unsigned long *)(SBIOS_BASE + SBIOS_SIGNATURE) == 0x62325350) {
bootinfo = (struct ps2_bootinfo *)KSEG0ADDR(PS2_BOOTINFO_OLDADDR);
memcpy(ps2_bootinfo, bootinfo, PS2_BOOTINFO_OLDSIZE);
oldbootinfo = 1;
} else
#endif
{
bootinfo = (struct ps2_bootinfo *)envp;
memcpy(ps2_bootinfo, bootinfo, bootinfo->size);
#ifdef CONFIG_AKMEM
akmem_bootinfo = (void )envp;
akmem_bootinfo_size = 0;
#endif /
CONFIG_AKMEM */
}

mips_machgroup = MACH_GROUP_EE;

switch (ps2_bootinfo->mach_type) {
case PS2_BOOTINFO_MACHTYPE_T10K:
    mips_machtype = MACH_T10000;
    break;
case PS2_BOOTINFO_MACHTYPE_PS2:
default:
    mips_machtype = MACH_PS2;
    break;
}

mips_memory_upper = KSEG0ADDR(ps2_bootinfo->maxmem);

/* get command line parameters */
if (ps2_bootinfo->opt_string != NULL) {
    int i;
    for (i = 0; i < CL_SIZE - 1 && ps2_bootinfo->opt_string[i]; i++)
	arcs_cmdline[i] = ps2_bootinfo->opt_string[i];
    arcs_cmdline[i] = '\0';
}
strcpy(arcs_cmdline, "root=/dev/hda1 crtmode=ntsc1");

if (*(unsigned long *)(ps2_bootinfo->sbios_base + SBIOS_SIGNATURE) != 0x62325350) {
	/* SBIOS not found */
	while (1)
		;
}
sbios = *(int (**)(int, void *))(ps2_bootinfo->sbios_base + SBIOS_ENTRY);
printk("PlayStation 2 SIF BIOS: %04x\n", sbios(SB_GETVER, 0));

printk("use boot information at 0x%x%s\n",
       bootinfo, oldbootinfo ? "(old style)" : "");
printk("boot option string at 0x%08x: %s\n",
       ps2_bootinfo->opt_string, arcs_cmdline);

return 0;

}

void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
{
/* nothing to do */
}

void prom_free_prom_memory (void)
{
/* nothing to do */
}
ここまで、編集して終了

その後にB.B.Navigatorから起動させるカーネルを構築する
make menuconfig
make dep
make clean
make
make modules
make modules install
exit
sudo cp -p vmlinux /mnt/bbn/boot/ps2linux-bbn-boot

sudo vi +52 /mnt/bbn/etc/rc.d/rc.sysinit
[rc.sysinit-52~62]
# Boot PS2 Linux if Controller bunnton is pressed
BUTTON=cat /proc/ps2pad | awk '$1==0 { print $5; }'
[ $PS2PAD -ne 0 ] && rmmod ps2pad
[ "$BUTTON" != "" -a "$BUTTON" != "FFFF" ] && /sbin/akload -r /boot/ps2linux-bbn-boot

/bin/rm -f /var/run/bn.pid /var/run/runlevel.dir /var/run/setcrtmode
/var/run/klog.pid /var/run/syslogd.pid
/bin/rm -f /var/lock/console/* /var/lock/samba/* /var/lock/subsys/*
/bin/rm -f /var/run/netreport/*
/bin/rm -f /tmp/.X*-lock
/bin/rm -f /tmp/[0-9a-f][0-9a-f][0-9a-f][0-9a-f]0-9a-f][0-9a-f][0-9a-f][0-9a-f]

sudo vi +92 /mnt/bbn/etc/rc.d/rc.sysinit
[rc.sysinit-92]
/usr/sbin/inetd

sudo shutdown -r now

この後はB.B.Navigatorの起動時にコントローラーの何かしらのボタンを押しているとB.B.Navigatorが落ちてPS2Linuxのカーネルが再起動されて立ち上がります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?