Compiling RUNIX (PSXLinux)

Miscellaneous and un-categorized content regarding the PlayStation 1
Dong
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Oct 01, 2012

Compiling RUNIX (PSXLinux)

Post by Dong » October 2nd, 2012, 12:23 am

I'm just gonna throw everything I can find about Runix here. I haven't found any compiled version of it so maybe someone here can compile the ancient source of it (I remember it was very problematic, not even the original coder of it could successfully compile it after I had contacted him on facebook some years ago so maybe it's not even possible ;) )

The old Runix homepage:
http://web.archive.org/web/200302061120 ... .runix.ru/
Runix download
1) https://code.google.com/p/runix-archive/downloads/list
2) mirror http://www.filewatcher.com/b/ftp/ftp.wa ... l.0.0.html
PSXLinux kernel beta 1 release.
--------------------------------

This archive contains beta 1 release of Linux kernel for Sony Playstation - PSXLinux.
PSXLinux based on uClinux 2.4.x kernel (http://www.uClinux.com) and contains specific support
for Sony Playstation.
Essential features were added:
1. virtual console over Playstation GPU improved;
2. Playstation memory card block driver improved:
- some bugs fixed;
- large memory card (4x,...) support added;
- two memory cards into one device joining support added;
3. console over Playstation SIO added (115200, 8N1);
4. Runix hardware add-on supported:
- USB host controller SL811H driver with keyboard and mouse support;
- RTC support.

INSTALLATION:
-------------
I. Prerequistes.

To compile PSXLinux kernel you will need:
1. Cross-compiler (egcc-1.1.2) and binutils-2.9.5 for Linux/i386 host
and MIPS little endian target. Binaries may be downloaded from
http://www.runix.ru or http://oss.sgi.com/mips.
2. PSXLinux kernel source tree. Download free the latest version from
http://www.runix.ru.

II. PSXLinux kernel source tree installation and compilation.

1. Create directory where kernel sources will be installed an put
kernel archive in it.

2. Unpack kernel archive.

gzip -cd <name>.tar.gz | tar xvf -

3. Delete stale object files and dependencies.

make mrproper

4. Configure kernel.

make config -- bash based configuration tool
or
make menuconfig -- text based color configuration tool with
menus, radiolists & dialogs
or
make xconfig -- X windows based configuration tool

You may load one of prepared configurations from file Config (simple configuration
without Runix hardware add-on support) or Config_Addon (configuration with Runix
hardware add-on support).

6. Compile kernel. You will get compiled kernel 'linux' in
the directory where kernel sources was installed (current directory).

make

7. Run compiled kernel on your game console.
Visit http://www.runix.ru for tools an instructions.

8. Now you may mount root file system from memory card. The memory card root image,
tools and instructions may be found on http://www.runix.ru.

Best regards !
And some dude that I think got it to work?
I've got a way to boot on the PSX (don't know if it works with a PS2). The trick is to use a Net Yaroze boot disc and to load your stuff on the PSX threw the serial port (or even maybe threw the parallel, but I've never herd of it). Indeed, you'll need three things :
- your PSX to have a mod-chip (in order to read the burned CD of the Net Yaro boot)
- this (http://hitmen.c02.at/html/psx_siocable.html) between your PSX and your computer in order to load the stuff
- the Net Yaro boot disc. I've got my copy on the old runix forum (but you may find it here : http://spazioinwind.libero.it/yarozeit/kit.htm , or surely on the link on this page : http://www.jeuxvideo.com/forums/1-60...pement-ps1.htm. Notice that the dev kit on of the first link is incomplete, but the one in the second link is. Maybe you'll need to have a spec region memory card as well.

You should also use a game-shark devise, or similar stuff, instead of the Skywalker Serial Cable.

All you should want to know is here : http://hitmen.c02.at/html/psx_faq.html and on the rest of the website.

Good luck.

likeabaus
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 133
Joined: Jul 27, 2016

Post by likeabaus » July 27th, 2016, 4:22 am

Hey all,

Not to bump an ancient thread, but I find this to be really interesting and didn't want to post yet another thread. Anybody with experience with linux and/or the psx hardware want to help me make this usable? I'm pretty good with linux, but I'm new to programming on the psx/amiga MIPS architecture. This could be used in conjunction with the overclocking mod (found here: http://djky2k3.tripod.com/psx_oc.html) too as the linux kernel (maybe not in its current state, but down the road) should be able to properly handle the increased clock speed. This would give us more resources to work with for homebrew development and for running homebrew.

Of course, the overclocking mod is not good for retail games (most are very unstable or have some sort of sound of GPU glitches since the games are optimized for the stock clock speed of 33mhz) but if you wire a switch to the overclocking mod, you could only switch it on for homebrew and have it off when playing retail games, giving you the best of both worlds. Also this would be a legal solution for developing homebrew for the psx/ps1 without needing to use the official sdk's. Anybody interested in this project?

sophiafox
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Aug 30, 2016

Post by sophiafox » August 30th, 2016, 6:28 am

Hi. I've managed to compile the kernel binary, but the documentation is very unclear about how to marge the rootfs with the kernel for emulation. Kernel works (given you convert it into the proper binary type). Likeabaus, perhaps you know something about making a rootfs?

likeabaus
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 133
Joined: Jul 27, 2016

Post by likeabaus » August 30th, 2016, 9:56 am

I've dealt with some other console based linux projects in the past, nothing on the psx at all, but i'm willing to give it a shot. Any chance you could upload the kernel executable so I can take a look at it?

UPDATE: I'm currently looking to get this compiled on my own while I await your response. Unfortunately I don't have a usb to serial cable for use with the playstation yet, and nor do I have a memory card (waiting for it to arrive in the mail) so I won't be able to do a whole lot, but want to see what I can pull off for now....

UPDATE 2: I can't seem to get this to compile using Ubuntu 16.04lts, keeps throwing the same error after configuring everything and running "make dep." "make dep" works fine but when I do the final step "make" to compile the kernel I get this same error stating that the compiler isn't installed correctly. At first I thought it was because I extracted the tar files using the gui, so I started over and followed the command line instructions to a tea and still no dice, same error. I've attached a screenshot of the error, anybody have any ideas of what i'm doing wrong? Also before you ask, I do have root privileges as you can see, but to be damn sure, i'm running as sudo su while trying to compile to kernel.

Image
You do not have the required permissions to view the files attached to this post.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » October 22nd, 2017, 3:12 pm

Well I tried today to compile it again and took a much deeper look into it, and after tackling the compiler issues, I got the thing working. Took me less than an hour to get it going. I need a Memory Card with the 'ext2' format on it though since it's panicking about the root filesystem missing, but I'm missing the file "mcard.0.8.2.tar.gz". Without this file, PSXLinux (RUNIX) is dead unfortunately. Otherwise, the only idea I can think of is to reverse the source code to see how and what it wants exactly, and try to re-create the memory card image file somehow.

Here it is running under NO$PSX (I captured the first load stage):
Image

Here it is running under real hardware (I captured the last load stage at where it freezes):
Image

Perhaps someone who is an absolute expert in Linux can help make an understanding of this information, since it might lead us on the right path to generating the filesystem we require.

Code: Select all

Using the initial RAM disk (initrd)
===================================

Written 1996,2000 by Werner Almesberger <[email protected]> and
                     Hans Lermen <[email protected]>


initrd provides the capability to load a RAM disk by the boot loader.
This RAM disk can then be mounted as the root file system and programs
can be run from it. Afterwards, a new root file system can be mounted
from a different device. The previous root (from initrd) is then moved
to a directory and can be subsequently unmounted.

initrd is mainly designed to allow system startup to occur in two phases,
where the kernel comes up with a minimum set of compiled-in drivers, and
where additional modules are loaded from initrd.

This document gives a brief overview of the use of initrd. A more detailed
discussion of the boot process can be found in [1].


Operation
---------

When using initrd, the system typically boots as follows:

  1) the boot loader loads the kernel and the initial RAM disk
  2) the kernel converts initrd into a "normal" RAM disk and
     frees the memory used by initrd
  3) initrd is mounted read-write as root
  4) /linuxrc is executed (this can be any valid executable, including
     shell scripts; it is run with uid 0 and can do basically everything
     init can do)
  5) linuxrc mounts the "real" root file system
  6) linuxrc places the root file system at the root directory using the
     pivot_root system call
  7) the usual boot sequence (e.g. invocation of /sbin/init) is performed
     on the root file system
  8) the initrd file system is removed

Note that changing the root directory does not involve unmounting it.
It is therefore possible to leave processes running on initrd during that
procedure. Also note that file systems mounted under initrd continue to
be accessible.


Boot command-line options
-------------------------

initrd adds the following new options:

  initrd=<path>    (e.g. LOADLIN)

    Loads the specified file as the initial RAM disk. When using LILO, you
    have to specify the RAM disk image file in /etc/lilo.conf, using the
    INITRD configuration variable.

  noinitrd

    initrd data is preserved but it is not converted to a RAM disk and
    the "normal" root file system is mounted. initrd data can be read
    from /dev/initrd. Note that the data in initrd can have any structure
    in this case and doesn't necessarily have to be a file system image.
    This option is used mainly for debugging.

    Note: /dev/initrd is read-only and it can only be used once. As soon
    as the last process has closed it, all data is freed and /dev/initrd
    can't be opened anymore.

  root=/dev/ram0   (without devfs)
  root=/dev/rd/0   (with devfs)

    initrd is mounted as root, and the normal boot procedure is followed,
    with the RAM disk still mounted as root.


Installation
------------

First, a directory for the initrd file system has to be created on the
"normal" root file system, e.g.

# mkdir /initrd

The name is not relevant. More details can be found on the pivot_root(2)
man page.

If the root file system is created during the boot procedure (i.e. if
you're building an install floppy), the root file system creation
procedure should create the /initrd directory.

If initrd will not be mounted in some cases, its content is still
accessible if the following device has been created (note that this
does not work if using devfs):

# mknod /dev/initrd b 1 250 
# chmod 400 /dev/initrd

Second, the kernel has to be compiled with RAM disk support and with
support for the initial RAM disk enabled. Also, at least all components
needed to execute programs from initrd (e.g. executable format and file
system) must be compiled into the kernel.

Third, you have to create the RAM disk image. This is done by creating a
file system on a block device, copying files to it as needed, and then
copying the content of the block device to the initrd file. With recent
kernels, at least three types of devices are suitable for that:

 - a floppy disk (works everywhere but it's painfully slow)
 - a RAM disk (fast, but allocates physical memory)
 - a loopback device (the most elegant solution)

We'll describe the loopback device method:

 1) make sure loopback block devices are configured into the kernel
 2) create an empty file system of the appropriate size, e.g.
    # dd if=/dev/zero of=initrd bs=300k count=1
    # mke2fs -F -m0 initrd
    (if space is critical, you may want to use the Minix FS instead of Ext2)
 3) mount the file system, e.g.
    # mount -t ext2 -o loop initrd /mnt
 4) create the console device (not necessary if using devfs, but it can't
    hurt to do it anyway):
    # mkdir /mnt/dev
    # mknod /mnt/dev/console c 5 1
 5) copy all the files that are needed to properly use the initrd
    environment. Don't forget the most important file, /linuxrc
    Note that /linuxrc's permissions must include "x" (execute).
 6) correct operation the initrd environment can frequently be tested
    even without rebooting with the command
    # chroot /mnt /linuxrc
    This is of course limited to initrds that do not interfere with the
    general system state (e.g. by reconfiguring network interfaces,
    overwriting mounted devices, trying to start already running demons,
    etc. Note however that it is usually possible to use pivot_root in
    such a chroot'ed initrd environment.)
 7) unmount the file system
    # umount /mnt
 8) the initrd is now in the file "initrd". Optionally, it can now be
    compressed
    # gzip -9 initrd

For experimenting with initrd, you may want to take a rescue floppy and
only add a symbolic link from /linuxrc to /bin/sh. Alternatively, you
can try the experimental newlib environment [2] to create a small
initrd.

Finally, you have to boot the kernel and load initrd. Almost all Linux
boot loaders support initrd. Since the boot process is still compatible
with an older mechanism, the following boot command line parameters
have to be given:

  root=/dev/ram0 init=/linuxrc rw

if not using devfs, or

  root=/dev/rd/0 init=/linuxrc rw

if using devfs. (rw is only necessary if writing to the initrd file
system.)

With LOADLIN, you simply execute

     LOADLIN <kernel> initrd=<disk_image>
e.g. LOADLIN C:\LINUX\BZIMAGE initrd=C:\LINUX\INITRD.GZ root=/dev/ram0
       init=/linuxrc rw

With LILO, you add the option INITRD=<path> to either the global section
or to the section of the respective kernel in /etc/lilo.conf, and pass
the options using APPEND, e.g.

  image = /bzImage
    initrd = /boot/initrd.gz
    append = "root=/dev/ram0 init=/linuxrc rw"

and run /sbin/lilo

For other boot loaders, please refer to the respective documentation.

Now you can boot and enjoy using initrd.


Changing the root device
------------------------

When finished with its duties, linuxrc typically changes the root device
and proceeds with starting the Linux system on the "real" root device.

The procedure involves the following steps:
 - mounting the new root file system
 - turning it into the root file system
 - removing all accesses to the old (initrd) root file system
 - unmounting the initrd file system and de-allocating the RAM disk

Mounting the new root file system is easy: it just needs to be mounted on
a directory under the current root. Example:

# mkdir /new-root
# mount -o ro /dev/hda1 /new-root

The root change is accomplished with the pivot_root system call, which
is also available via the pivot_root utility (see pivot_root(8) man
page; pivot_root is distributed with util-linux version 2.10h or higher
[3]). pivot_root moves the current root to a directory under the new
root, and puts the new root at its place. The directory for the old root
must exist before calling pivot_root. Example:

# cd /new-root
# mkdir initrd
# pivot_root . initrd

Now, the linuxrc process may still access the old root via its
executable, shared libraries, standard input/output/error, and its
current root directory. All these references are dropped by the
following command:

# exec chroot . what-follows <dev/console >dev/console 2>&1

Where what-follows is a program under the new root, e.g. /sbin/init
If the new root file system will be used with devfs and has no valid
/dev directory, devfs must be mounted before invoking chroot in order to
provide /dev/console.

Note: implementation details of pivot_root may change with time. In order
to ensure compatibility, the following points should be observed:

 - before calling pivot_root, the current directory of the invoking
   process should point to the new root directory
 - use . as the first argument, and the _relative_ path of the directory
   for the old root as the second argument
 - a chroot program must be available under the old and the new root
 - chroot to the new root afterwards
 - use relative paths for dev/console in the exec command

Now, the initrd can be unmounted and the memory allocated by the RAM
disk can be freed:

# umount /initrd
# blockdev --flushbufs /dev/ram0    # /dev/rd/0 if using devfs

It is also possible to use initrd with an NFS-mounted root, see the
pivot_root(8) man page for details.

Note: if linuxrc or any program exec'ed from it terminates for some
reason, the old change_root mechanism is invoked (see section "Obsolete
root change mechanism").


Usage scenarios
---------------

The main motivation for implementing initrd was to allow for modular
kernel configuration at system installation. The procedure would work
as follows:

  1) system boots from floppy or other media with a minimal kernel
     (e.g. support for RAM disks, initrd, a.out, and the Ext2 FS) and
     loads initrd
  2) /linuxrc determines what is needed to (1) mount the "real" root FS
     (i.e. device type, device drivers, file system) and (2) the
     distribution media (e.g. CD-ROM, network, tape, ...). This can be
     done by asking the user, by auto-probing, or by using a hybrid
     approach.
  3) /linuxrc loads the necessary kernel modules
  4) /linuxrc creates and populates the root file system (this doesn't
     have to be a very usable system yet)
  5) /linuxrc invokes pivot_root to change the root file system and
     execs - via chroot - a program that continues the installation
  6) the boot loader is installed
  7) the boot loader is configured to load an initrd with the set of
     modules that was used to bring up the system (e.g. /initrd can be
     modified, then unmounted, and finally, the image is written from
     /dev/ram0 or /dev/rd/0 to a file)
  8) now the system is bootable and additional installation tasks can be
     performed

The key role of initrd here is to re-use the configuration data during
normal system operation without requiring the use of a bloated "generic"
kernel or re-compiling or re-linking the kernel.

A second scenario is for installations where Linux runs on systems with
different hardware configurations in a single administrative domain. In
such cases, it is desirable to generate only a small set of kernels
(ideally only one) and to keep the system-specific part of configuration
information as small as possible. In this case, a common initrd could be
generated with all the necessary modules. Then, only /linuxrc or a file
read by it would have to be different.

A third scenario are more convenient recovery disks, because information
like the location of the root FS partition doesn't have to be provided at
boot time, but the system loaded from initrd can invoke a user-friendly
dialog and it can also perform some sanity checks (or even some form of
auto-detection).

Last not least, CD-ROM distributors may use it for better installation
from CD, e.g. by using a boot floppy and bootstrapping a bigger RAM disk
via initrd from CD; or by booting via a loader like LOADLIN or directly
from the CD-ROM, and loading the RAM disk from CD without need of
floppies. 


Obsolete root change mechanism
------------------------------

The following mechanism was used before the introduction of pivot_root.
Current kernels still support it, but you should _not_ rely on its
continued availability.

It works by mounting the "real" root device (i.e. the one set with rdev
in the kernel image or with root=... at the boot command line) as the
root file system when linuxrc exits. The initrd file system is then
unmounted, or, if it is still busy, moved to a directory /initrd, if
such a directory exists on the new root file system.

In order to use this mechanism, you do not have to specify the boot
command options root, init, or rw. (If specified, they will affect
the real root file system, not the initrd environment.)
  
If /proc is mounted, the "real" root device can be changed from within
linuxrc by writing the number of the new root FS device to the special
file /proc/sys/kernel/real-root-dev, e.g.

  # echo 0x301 >/proc/sys/kernel/real-root-dev

Note that the mechanism is incompatible with NFS and similar file
systems.

This old, deprecated mechanism is commonly called "change_root", while
the new, supported mechanism is called "pivot_root".


Resources
---------

[1] Almesberger, Werner; "Booting Linux: The History and the Future"
    ftp://icaftp.epfl.ch/pub/people/almesber/booting/bootinglinux-current.ps.gz
[2] newlib package (experimental), with initrd example
    ftp://icaftp.epfl.ch/pub/people/almesber/misc/newlib-linux/
[3] Brouwer, Andries; "util-linux: Miscellaneous utilities for Linux"
    ftp://ftp.win.tue.nl/pub/linux-local/utils/util-linux/
Another thing that might help is the source code to the 'addinitrd.c' program. It might shed some light on how the filesystem is actually injected into the kernel image:

Code: Select all

/*
 * addinitrd - program to add a initrd image to an ecoff kernel
 *
 * (C) 1999 Thomas Bogendoerfer
 */

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#include "ecoff.h"

#define MIPS_PAGE_SIZE	4096
#define MIPS_PAGE_MASK	(MIPS_PAGE_SIZE-1)

#define swab16(x)         ((unsigned short)(                 (((unsigned short)(x) & (unsigned short)0x00ffU) << 8) |                 (((unsigned short)(x) & (unsigned short)0xff00U) >> 8) ))

#define swab32(x)         ((unsigned int)(                 (((unsigned int)(x) & (unsigned int)0x000000ffUL) << 24) |                 (((unsigned int)(x) & (unsigned int)0x0000ff00UL) <<  8) |                 (((unsigned int)(x) & (unsigned int)0x00ff0000UL) >>  8) |                 (((unsigned int)(x) & (unsigned int)0xff000000UL) >> 24) ))

#define SWAB(a)	(swab ? swab32(a) : (a))

void die (char *s)
{
	perror (s);
	exit (1);
}

int main (int argc, char *argv[])
{
	int fd_vmlinux,fd_initrd,fd_outfile;
	FILHDR efile;
	AOUTHDR eaout;
	SCNHDR esecs[3];
	struct stat st;
	char buf[1024];
	unsigned long loadaddr;
	unsigned long initrd_header[2];
	int i;
	int swab = 0;

	if (argc != 4) {
		printf ("Usage: %s <vmlinux> <initrd> <outfile>\n",argv[0]);
		exit (1);
	}

	if ((fd_vmlinux = open (argv[1],O_RDWR)) < 0)
		 die ("open vmlinux");
	if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile)
		die ("read file header");
	if (read (fd_vmlinux, &eaout, sizeof eaout) != sizeof eaout)
		die ("read aout header");
	if (read (fd_vmlinux, esecs, sizeof esecs) != sizeof esecs)
		die ("read section headers");

	/*
	 * check whether the file is good for us
	 */
	/* TBD */

	/*
	 * check, if we have to swab words
	 */
	if (ntohs(0xaa55) == 0xaa55) {
		if (efile.f_magic == swab16(MIPSELMAGIC))
			swab = 1;
	} else {
		if (efile.f_magic == swab16(MIPSEBMAGIC))
			swab = 1;
	}

	if ((fd_initrd = open (argv[2], O_RDONLY)) < 0)
		die ("open initrd");
	if (fstat (fd_initrd, &st) < 0)
		die ("fstat initrd");
	loadaddr = ((SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size) 
			+ MIPS_PAGE_SIZE-1) & ~MIPS_PAGE_MASK) - 8;
	if (loadaddr < (SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)))
		loadaddr += MIPS_PAGE_SIZE;
	initrd_header[0] = SWAB(0x494E5244);
	initrd_header[1] = SWAB(st.st_size);
	eaout.dsize = esecs[1].s_size = initrd_header[1] = SWAB(st.st_size+8);
	eaout.data_start = esecs[1].s_vaddr = esecs[1].s_paddr = SWAB(loadaddr);

	if ((fd_outfile = open (argv[3], O_RDWR|O_CREAT|O_TRUNC,0666)) < 0)
		die ("open outfile");
	if (write (fd_outfile, &efile, sizeof efile) != sizeof efile)
		die ("write file header");
	if (write (fd_outfile, &eaout, sizeof eaout) != sizeof eaout)
		die ("write aout header");
	if (write (fd_outfile, esecs, sizeof esecs) != sizeof esecs)
		die ("write section headers");
	while ((i = read (fd_vmlinux, buf, sizeof buf)) > 0)
		if (write (fd_outfile, buf, i) != i)
			die ("write vmlinux");
	if (write (fd_outfile, initrd_header, sizeof initrd_header) != sizeof initrd_header)
		die ("write initrd header");
	while ((i = read (fd_initrd, buf, sizeof buf)) > 0)
		if (write (fd_outfile, buf, i) != i)
			die ("write initrd");
	close (fd_vmlinux);
	close (fd_initrd);
	return 0;
}
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
CodeAsm
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 69
Joined: Jan 13, 2012
I am a: Programmer, Student
Location: The Netherlands
Contact:

Post by CodeAsm » October 24th, 2017, 9:07 pm

Time for me to try again, how did you convert the resulting kernel file into an ecoff file or how did you transfer the kernel to the PS1 ? I would love to try reverseing the memorycard code (or write new one, cause it looks like its kinda lost)

For experience I tried this: http://mgalgs.github.io/2015/05/16/how- ... ition.html it might help in some way but not much.
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » October 24th, 2017, 9:37 pm

I compiled and used "elf2ecoff.c" under the "arch\mipsnommu\boot" directory. Under Windows, I then used EXEFIXUP.EXE to make the PS-EXE a multiple of 2048 bytes, and booted the kernel image (PS-EXE) from PSIO, but anything would work (CD-ROM, PSXSERIAL, PSEXE.COM or CATFLAP, etc).
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

likeabaus
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 133
Joined: Jul 27, 2016

Post by likeabaus » October 24th, 2017, 9:39 pm

Shadow, that's awesome! I couldn't even get it to compile but you at least got the executable running! Any chance you can upload the executable somewhere for others to look at? I'm in the process of repairing a psx motherboard at the moment so I don't currently have a functioning unit, but once I do, I'd be willing to experiment with creating a root filesystem on the memory card. It "should" be possible to write said file system to a memory card using memcarduino :)

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » October 24th, 2017, 9:40 pm

Sure, here you go. There isn't much to see or do though without a filesystem :P

In theory, a filesystem could be used in RAM since 1.4 MB is free, but how to do it, I don't know.
I'm not a Linux expert ;)
:null:
PSXLINUX.EXE
You do not have the required permissions to view the files attached to this post.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
CodeAsm
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 69
Joined: Jan 13, 2012
I am a: Programmer, Student
Location: The Netherlands
Contact:

Post by CodeAsm » October 27th, 2017, 11:37 pm

yours is slightly larger and I see you compiled it from a root folder: /PSXLinux/... while CyrusDevX had the path /home/kostya/kernel/PSXLinux/... It might not be too important, but it wont hurt me to try the same thing.

I know its posible on x86 to include a small initram fs with the kernel, but im not sure if it will fit. either way, I would love memorycard support, so ill look into this aswell.
[edit] never mind, you tried No$psx and I got it to work under qemu. Now the rootfs ;)
Digging while I also need to finish some homework (AVR SPI programming), /drivers/block/bu.c seems to give the most clues.
Ill either edit this post or reply if I find more
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » October 28th, 2017, 9:10 am

Well seeming as a Memory Card is 128 KB, there is actually lots of RAM free, so it'd be better to utilise that instead. It would also be ridiculously faster than using a Memory Card as the filesystem. I too have read it's possible to include a RAM disk file system with the kernel, but as per how to do it, I don't know exactly (again, I'm not a Linux expert :P ).
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
CodeAsm
Verified
Active PSXDEV User
Active PSXDEV User
Posts: 69
Joined: Jan 13, 2012
I am a: Programmer, Student
Location: The Netherlands
Contact:

Post by CodeAsm » October 28th, 2017, 11:43 pm

I agree, tho I might try the memorycard way first. there is multicard support if I can make 1 card work (I think ext2 is fine for the test, if I have a choise). Including a initramfs with the kernel would be even smart, make it run and see for availeble storage devices later is a must have almost.(I mean, a initramfs is even ment to setup other hardware to load the final system after this) when we either have a Memorycard (store just a (user) program on there) or use USB (I have a controller already, was 9 euro). Maybe a driver for the PIO adapter some of you guys have, load the new FS from SD card? back then, the memorycard was the cheapest option,today, we either just burn a new disk or use some hardware contraption we cheaply build.

I dont have much time this weekend, but ive been playing arround with bu.c (made a copy) and might be able to generate a valid MU image. Gzipping a initramfs and adding it to the kernel might be a more wise aprouch. Do you use a special ecoff to PS exe tool from PshyQ or something? I was able to compile my kernel a few months ago, but I could not generate a vallid kernel at all (the EXE was empty, no headers,code or data at all. the elf seemed fine).

eco2exe dint work for me. (tried under Windows aswell )
Development Console: SCPH-102, unkown clone Modchip, PAL , FTDI board build into the case (microUSB) for Serial I/O.
Development Computer: GNU/Linux, Arch x86_64 Linux 4.20.3, i7-3632QM [8x3.2GHz], 11,8GiB, 1366x768 GeForce GT 630M (Optimus tech), lots of gig of storage

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » October 29th, 2017, 9:37 am

You need to compile "elf2ecoff.c" under Linux (gcc -o elf2ecoff elf2ecoff.c).
You actually use it via "elf2ecoff linux linux.ecoff".

Then, you use "eco2exe linux.image.ecoff" (via Windows).
Finally, "exefixup linux.exe" (via Windows).

Oh, and if GCC complains about 'elf2ecoff' not able to compile, check the includes as "stdio.h" might be missing.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » November 19th, 2017, 10:49 pm

There's some interesting driver/PIO mod for USB keyboard!
Maybe an alternative to PSX Keyboard/Mouse SCPH-2000: www.psxdev.net/forum/viewtopic.php?f=54&t=140

From README.PSXLinux in PSXLinux-kernel-2.4.x-beta1.tar.gz (newest date in archive): https://code.google.com/archive/p/runix ... /downloads

Notice #4
PSXLinux kernel beta 1 release.
--------------------------------

This archive contains beta 1 release of Linux kernel for Sony Playstation - PSXLinux.
PSXLinux based on uClinux 2.4.x kernel (www.uClinux.com) and contains specific support
for Sony Playstation.
Essential features were added:
1. virtual console over Playstation GPU improved;
2. Playstation memory card block driver improved:
- some bugs fixed;
- large memory card (4x,...) support added;
- two memory cards into one device joining support added;
3. console over Playstation SIO added (115200, 8N1);
4. Runix hardware add-on supported:
- USB host controller SL811H driver with keyboard and mouse support;
- RTC support.

file: drivers/usb/sl811h.c
/**********************************************************
/ file sl811h.c
/ description linux driver for SL811HS USB host controller
/ written by Burmistrov. A, [email protected]

/ history 15.05.2001 nothing
01.06.2001 working control transfers
19.06.2001 working int transfers (mouse works)
27.06.2001 keyboard works
02.07.2001 multiple sl811hs controllers
in one system supported
22.07.2001 keyboard works stable
20.08.2001 remade almost thorowly (use interrupts)
kbd and mouse still work :)
/ todo 1.bulk
2.iso
3.SMP locks. Currently this driver can
work only on 1-processor system
***********************************************************/
line:766 // we share PIO irq line with Smart Media controller on PIO extension board

quick search, found:
http://www.cypress.com/files/sl811hs-em ... tasheetpdf
First USB Host/Slave controller for embedded systems in the market with a standard microprocessor bus interface
Conforms to USB Specification 1.1 for full- and low speed

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » November 19th, 2017, 11:19 pm

I heard they made a USB peripheral for RUNIX, but I couldn't find anything in relation to it. The sources might indicate something though like you stated 'gwald'. Nice find, but we will need to figure out how to get the system to boot properly :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » November 19th, 2017, 11:51 pm

@Shadow which version did you build? https://code.google.com/archive/p/runix ... /downloads
And what compiler did you use? the one that's there?

Looking at the archive on their repos, the 'newest' one was: 25.40 MB 2002-05-31 kernel-psx-2.4.0.tar.gz
https://web.archive.org/web/20080212153 ... l.0.0.html
But looking in the archive file all files are from 2001 :shrug

User avatar
CosmoGuy
Serious PSXDEV User
Serious PSXDEV User
Posts: 91
Joined: May 30, 2012
I am a: Hell knows who I am
PlayStation Model: SCPH-7502
Location: Polska, Wroclaw
Contact:

Post by CosmoGuy » November 20th, 2017, 12:48 am

:o :praise
Aw man love to see what will happen with it.
Leaving tactical reply here
Image

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » November 20th, 2017, 3:09 pm

I'm not sure what version I used because the README files don't say anything specific, but I believe it was from "PSXLinux-kernel-2.4.x-beta1.tar".
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » November 24th, 2017, 8:54 am

Which build chain did you use to build it?

I think Linux is a bit ambitious for a 33Mhz machine, probably why it was scrapped in favor of PS2 Linux.

Better alternatives would be:
http://elks.sourceforge.net/
https://github.com/EtchedPixels/FUZIX
http://www.freertos.org/
http://minix3.org
https://github.com/HelenOS/helenos (looks like it has MIPS R3000 CPU support)

https://en.wikipedia.org/wiki/Ancient_UNIX (http://minnie.tuhs.org/cgi-bin/utree.pl)

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » November 24th, 2017, 3:44 pm

Let me know what commands to run so I can check the buildchain versions for you.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests