Page 3 of 3

Re: Compiling RUNIX (PSXLinux)

Posted: January 8th, 2020, 1:16 am
by Shadow
Looks like the card image is still missing some critical kernel data. I'm surprised that no one has the actual Memory Card file image we need in order to boot this thing up.

Re: Compiling RUNIX (PSXLinux)

Posted: January 19th, 2020, 8:20 am
by danhans42
You need the missing tool to build a rootfs on a memory card. I suppose you could look through the code to see how it's mounted and try and to understand the format.

I tried this years ago with a pre-built image, and that was always the stumbling block. It didn't output and video from memory, just serial. The tools to build the rootfs was not included in the source.

I assume the rootfs image they had for a memory card had busybox on it or something simple to get up and running.

Re: Compiling RUNIX (PSXLinux)

Posted: January 20th, 2020, 12:53 pm
by Shadow
Honestly the best thing would probably be to just build an entire new system of Linux, but it's not going to be much use unless the 8 MB RAM modification is done and we have a keyboard on the PlayStation. Getting Ethernet communications would also be ideal but that can be done last. It's a lot of work and a big project, but it's doable and it would be super awesome :)

Re: Compiling RUNIX (PSXLinux)

Posted: July 26th, 2020, 6:12 am
by UselessSoftware
I think creating a new Linux for PSX is a great idea. Runix is what, Kernel 2.2? I'd be glad to help how I can. I'm a programmer, but I don't know if I have enough Linux kernel expertise specifically. It would be awesome to get Ethernet support working though, imagine your Playstation sitting in the corner serving up web pages. :)

What made me interested in this is that I'm writing a MIPS R2000/R3000 emulator and thought a Linux kernel meant for the PSX would be a decent starting point to get it running something useful. Maybe It'll become a full blown PSX emulator, but a quick glance at the GPU tech info makes me cry.

Re: Compiling RUNIX (PSXLinux)

Posted: July 28th, 2020, 6:57 am
by UselessSoftware
I'm playing around with compiling a simple 5.7 kernel for MIPS I and no MMU. If I successfully get it to boot, I'm going to look into creating some simple kernel drivers for PSX things like memory cards, SIO, GPU console etc.

I suspect there won't be enough RAM for a kernel this new though... may have to go back quite a bit, but I'll see how it looks when stripped down.

One thing I noticed about the old PSXLinux kernel was that the SIO drivers were broken completely. It tried to use the data register for all control actions for some reason.

EDIT: Yeah, that made a 150 MB ELF file... :lol:

Re: Compiling RUNIX (PSXLinux)

Posted: July 29th, 2020, 3:02 am
by Shadow
If you get Linux to boot correctly, then we can add 8 MB in total to the PSX which will help considerably.

Re: Compiling RUNIX (PSXLinux)

Posted: July 29th, 2020, 3:52 am
by UselessSoftware
I'm starting to think it would be best to just take the 2.4 Runix kernel and improve on it/fix it. It's a good start and pretty small. You could do a few things with that in an 8 MB PSX.

EDIT: Also, the 5.7 kernel generates output with up to MIPS ISA IV instructions even when configured to run on an R3000. It's probably inline assembly somewhere.

Re: Compiling RUNIX (PSXLinux)

Posted: October 18th, 2022, 11:55 am
by longboarder241
Shadow wrote: January 20th, 2020, 12:53 pm Honestly the best thing would probably be to just build an entire new system of Linux, but it's not going to be much use unless the 8 MB RAM modification is done and we have a keyboard on the PlayStation. Getting Ethernet communications would also be ideal but that can be done last. It's a lot of work and a big project, but it's doable and it would be super awesome :)
The ethernet may be somewhat easy with the correct tools and may be able to be done theoretically through the controller port. A long time ago I got one of the docomo cell phone cables and one interesting thing about them is that they allowed people to browse the web on their ps1 using the data from the cell phone. If cellular data can come through the ps1 controller port whose to say ethernet could be possible too.

Re: Compiling RUNIX (PSXLinux)

Posted: October 18th, 2022, 2:17 pm
by Shadow
Controller port would be way too slow. You'd want to use the parallel port to take full advantage of the Ethernet speeds, but it depends what you'd want to do with it. The best and easiest solution would be to just use the serial port with a modem.

Re: Compiling RUNIX (PSXLinux)

Posted: November 10th, 2022, 8:17 am
by doscore
danhans42 wrote: January 19th, 2020, 8:20 am You need the missing tool to build a rootfs on a memory card. I suppose you could look through the code to see how it's mounted and try and to understand the format.

I tried this years ago with a pre-built image, and that was always the stumbling block. It didn't output and video from memory, just serial. The tools to build the rootfs was not included in the source.

I assume the rootfs image they had for a memory card had busybox on it or something simple to get up and running.
as a person that uses linux on the ps2 (Black rhino linux & Debian 5 Lenny) if you are getting stuck at the rootfs part of the boot stage I wonder if formatting a memory card on my setup (ps2 linux)with mkfs.ext2 loaded with busy box and a few other configs + tools is all you need to get this kernel to recognise the partition. edit the fstab files to reflect that within the initrd. I think there maybe some interesting tools or ideas you can borrow from this project to understand how it could work here on psx. we could take the initrd from BRL as this also works on newer and older kernels on the ps2..slim it down of course

I have never tried to format a psx memory card from ps2 linux but I think its worth a shot. im also on the search for the chips to upgrade to 8mb ram (EDO based sticks I have happen to be the 5v versions sadly). so if you can mount the initrd from the memory card and have 8mb ram I think you would be able to get to a busy box shell at least.

im just waiting for my pcx serial cable and FTDI USB adapter and I will give it a shot and if I can get the chips I will upgrade my pcx to 8mb which will give us more room to play with.

Re: Compiling RUNIX (PSXLinux)

Posted: November 10th, 2022, 11:35 am
by Shadow
If you can send me the file for the Memory Card, I can try it :)

Re: Compiling RUNIX (PSXLinux)

Posted: November 10th, 2022, 5:06 pm
by doscore
So while i am able to read ps2 cards i have been unable to access the PSX FS which is a shame.. BUT not all hope is lost..

Image


Image

i did try to setup the psxlinux.exe here with a bunch of other homebrew on a disc via UNIROM but everything shows as a <DIR> directory so i was unable to test out the compiled version.. im pretty new to unirom and the PSX scene but i have been playing with the PS2 for a while so... if there is something else i need to do to make the .EXE file executable from unirom? let me know

Image

i was hoping to run the psxlinux binary and try see if i can load the initrd.gz from BRL.. it probably wont work but i wanted to see the kernel loading for myself without the use of the serial port until my cable turns up.

Image

i tried using psxlicense to make the listed PSXLINUX.EXE automatically boot but no dice lol.

Re: Compiling RUNIX (PSXLinux)

Posted: November 10th, 2022, 6:22 pm
by Shadow
I've never used UniRom. I prefer Lameguy's n00bROM :)

Just try it in an emulator for now. I recommend NO$PSX or DuckStation. In the latest build of NO$PSX, you can finally enable 8 MB RAM too which is awesome (while DuckStation has had it just after launch if I recall).

Re: Compiling RUNIX (PSXLinux)

Posted: November 10th, 2022, 9:58 pm
by doscore
Shadow wrote: November 10th, 2022, 6:22 pm I've never used UniRom. I prefer Lameguy's n00bROM :)

Just try it in an emulator for now. I recommend NO$PSX or DuckStation. In the latest build of NO$PSX, you can finally enable 8 MB RAM too which is awesome (while DuckStation has had it just after launch if I recall).
yes for sure ill give that method a go aswell, ideally id like to push the kernel through the serial port so i can use the 8mb upgrade from there and i was looking into the data addresses and mapping today and it mentioned things i found from here http://www.psxdev.net/forum/viewtopic.php?t=488

i was trying to compile the code today but i was a really half-assed attempt if im honest lol but i was looking around for the initrd information today

so the general gist for those who dont know linux too well this is the general boot idea..

PART ONE:

#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 if the root device is not /dev/ram0, the old (deprecated) change_root procedure is followed.

#4 root device is mounted. if it is /dev/ram0, the initrd image is then mounted as root.

#5 /sbin/init 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).

We only need to get the kernel to boot to this point here #5 which is enough to load busybox and some basic apps. id consider that as technically still running linux. To save memory you could probably unmount the init filesystem after you you mount the "real" root file system BUT i believe this is as far as the runix guys got because you cannot mount a 128kb EXT2 partition if you were planning to use the memory card for anything..because it out of range.. even with a smaller byte size or even super blockwise too BUT perhaps an 8MB ram upgrade would assist in having a small ramdisk or extra memory from the parallel port? (yeah whole project on its own lol)

PART 2:
figure out somewhere to put linux and its root system outside of the ram and thats where the real problems begin lol im thinking of a parallel port storage device.. i might mock up some gerber files for an idea if we ever make it this far or if i get too drunk one night.

#6 init mounts the “real” root file system

#7 init places the root file system at the root directory using the pivot_root system call

#8 init execs the /sbin/init on the new root filesystem, performing the usual boot sequence

#9 the initrd file system is removed

in conclusion...get it to the busybox stage which with the right initrd we could make a very basic set of tools to test in an emulator like you have suggested... ill wait for my serial cable and ftdi stuff to turn up and in the mean time see if i can build a little initrd that could perhaps be a bootable cd or something for users who donot have the dev kits etc.



PART 3 LINUX ON PSP
SO.. THE PSP is also a Mips CPU but the R4000 but they also have a much better kept version of µClinux with tools and code that can probably help us fill in the gaps? there are some similarities when looking around the code but its still different but i thought id just note this here for suture reference for others too.

https://sites.google.com/site/linuxonpspproject/

:UPDATE

the config file for this version (µClinux 2.6 for PSP) has options for the mip R3000 and also has many more options to add CONFIG_BLK_DEV_INITRD=y which means as long as you have the initrd.gz in the same directory as the LINUXPSX.EXE binary you should be able to boot a ramdisk etc..

CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="/usr/src/busybox/busybox.cpio"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0

these options are missing from the runix as well as

#
# Block devices
#
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=4
CONFIG_BLK_DEV_RAM_SIZE=4096 <<<<<< 4 MB of RAMFS?
CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
# CONFIG_CDROM_PKTCDVD is not set
CONFIG_BLK_DEV_PSP_MS=y <<< this wont work

.

Re: Compiling RUNIX (PSXLinux)

Posted: December 22nd, 2022, 7:21 am
by CodeAsm
doscore wrote: November 10th, 2022, 9:58 pmi believe this is as far as the runix guys got because you cannot mount a 128kb EXT2 partition if you were planning to use the memory card for anything..
I dont know what FS they used but they have code inside the runix sources for multicard support, and they say they planned on CF card support (or had it working but no code shared), had an RTC, and USB working (usb controller was 1.0 or 1.1 I believe). USB code can already be found inside the sources.

So they appear to have fixed the storage problem, biggest hurtle we have, is we lack the formatting tool, but I did find out they wrote some few bytes to the beginning of the memory unit to identify if your MU was a single storage MU or multi (and if mutli, what number of MU it was from a sequence)

If the ram mod would allow you to load a "usable" initramfs, I am willing to do the mod aswell for testing, I already wanted to try that mod anyway someday. the memory formatting was and may still be my dream of getting to work. the reading code should be there, and if its indeed a regular FS(filesystem) it should be possible to recreate (but not much but a hello world would fit im afraid)

Re: Compiling RUNIX (PSXLinux)

Posted: June 12th, 2023, 1:56 am
by doscore
After some long hard work beta 2 finally compiles I'll have the code up on git later this week

The proc file system in relation to kcore.c,(about binary files) shm.c (shared memory) , sysctl, etc..

This is an important step because we were unable to compile a new kernel without using the existing config files.

Compiling the same kernel is fine if you want to use it the way the runix guys intended but I'm looking at the ram and initrd way.

I do now have enough memory cards and boomerangs to make the raid system work but the ext fs to the memory cards is an issue so I created a ex2. Img file with 128kb (131..) and attempted to use exe2mem.py with some changes and I thought it worked but it's just a corrupt fs.

So now that we have managed to compile the beta version I will be starting a new "distro" I'm calling "black roo Linux".

So there's hope on the horizon for Linux on the psx.

UPDATE: while i can get an ecoff to build i cannot convert it to an exe file using eco2exe :(

UPDATE 2: https://github.com/arkwise/blackroolinux

Image

Re: Compiling RUNIX (PSXLinux)

Posted: November 12th, 2023, 12:30 pm
by Ivan Costa
Compiled and ran BlackrooLinux!

But the kernel panics, not able to mount ROOTFS.

Compiled with 16 ramdisks of 128kb but not know how to fill them.

Followed the instructions but I wasnt succesful on booting from an ramdisk.img. Thinking the busybox inside de image must be MIPS architecture (I've just apt get busybox :\ )

Now the most important problem I face is that I dont know what the command line arguments (at file cmdline.c) must be to the machine boots. Tried some, but none have worked. boot=? initrt=?

Testing the .EXE on emulators only, although I have an actual machine, and it had worked only on NO$PSX. It didn't run on DuckStation, I don't know why.

Waiting for new updates from the github or the community.
Thanks, Ivan

Re: Compiling RUNIX (PSXLinux)

Posted: November 14th, 2023, 6:03 am
by Ivan Costa
The CDROM drivers available on the source from Runnix / BlackrooLinux are compatible with the drive from the console/emulators? I dont't think so.

What about creating a kernel module to deal with the CDROM drive from the PSX ?

There are Linux live CDs, for example Knoppix 3.3 (from 2003) who runs kernel 2.4 and don't need an HD or floppy, just the CDROM (and much more RAM, to use the GUI)

I think the task is HUGE but there is source code from, like, DUCKSTATION, to get the hints.

https://github.com/stenzek/duckstation/ ... /cdrom.cpp

It's 3K lines of C++ .

There is a lot of information about the CD internals addresses and etc at the NO$PSX help menu, too.

Have a nice week,
Ivan Costa

Re: Compiling RUNIX (PSXLinux)

Posted: November 26th, 2023, 1:21 am
by doscore
Oh cool cheers for testing it out, ive been too busy lately. this initial build version of blackroo was the beta version of runnix as historically it wasnt building but the alpha version was.


I have my 8mb ps2 console that i need to test it on. yes everything needs to be built for mips (on an old 32 bit system like ubuntu 12/14) for it to work in the initrd or root etc.

root= is defined at the time of compilation when you select the drive support in the kernel settings somewhere i remember seeing it. to specify a different device name 00:01 for example ive got no clue at this stage,

yes that image does not boot its broken. i need to get back into this.

the 128k images need to be put on the memory cards, this contains the rootfs swap to device root. the next step was to build an image with busybox and basic tools to fit within 256kb or so. i wanted to use a raspberry pi which i have built but not tested yet. ive also got multi-taps for testing multiple memory cards.

building a module will work for sure but my goal for now was getting it to boot on memory modded systems for now as it was going to be easier for me with 8mb.

can you send me a copy of your exe please? im feeling a little inspired to have a look at it again