Loading an ELF file above 0x80000000

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

Mega Man,

The last bit about the kernel parameter was what I meant. Thanks. It still kernel panics during boot using the base bbnav kernel downloaded from playstation2-linux.com, but I'm using a hard drive with hdloader games and two linux partitions (Montavista on one, Black Rhino on the other) in addition to my swap partition. I may have to use an old hard drive with a clean install to test better or muck around with the kloader settings/modules loaded at startup. Since you are able to use kloader to start your /dev/hda2 partition's Linux, you give me great hope to be able to do the same with a little bit of troubleshooting. Sorry to take so long to post, I wanted to have enough time to do testing with the different modules/more boot attempts to make sure I'm not missing the obvious...that and I'm in the middle of updating to dillo 0.8.6 and xmms 1.2.11 which means alot of compiling of libraries/support programs (sed, wget, libpng, zlib, openssl, openssh) to get everything working again under my PS2 Linux. I'll work more on Monday to see if I can find my boot problems.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

Can you give a hyper link to the kernel, so I know which version you use.
Did you use a version with APA support?
I believe the kernel parameters are different when using APA.
You should first try my version:
http://mitglied.lycos.de/ps2dev/vmlinux
This version doesn't have APA support.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

I got the kernel from http://playstation2-linux.com/files/mozilla-ps2/vmlinux

Register on the website for free first, login, then the link will work. As this kernel is APA-compatible, I also think this might be the issue. I can test with your kernel with a clean hard drive (no APA issues) and then check the kernel I typically use as a good starting test point.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

The kernel is working with the linux system on my hard disc.
gst
Posts: 1
Joined: Mon Feb 18, 2008 3:49 pm

Post by gst »

Wow, it's nice to see that development on ps2 is still going somewhere.

I've just now tried out your loader with the supplied 2.4.17 kernel image, and it runs my linux installation (before I was using a not-quite standard 2.2.1 with APA support) reasonably well.

However, during shutdown the kernel panicked:
Image

I'm not sure if this will help much, or at all. But you never know.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I've also seen this panic at shutdown. It is not not critical, because it happens after killing all processes and unmounting the partition. I believe it happens, because at the end it will make a RPC call to CDVD, which power off the system. CDVD is not activated, because system will not start with it, when debug output is disabled.
I've also seen similar exceptions on a normal PC runnning Linux 2.4, when power off was not working.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

Strange - I can boot your 2MB kernel but not the 3MB kernel (which reaches the partition hda1: section of the boot before kernel panic) from my previous link on my version 3 console. Either way, I'm happy with the results with your kernel -- my /dev/hda1 partition co-exists with HDL partitions (APA) and everything functions as you say it does, sound being the major lacking function. X-Windows graphics, network, hard drive, mount of /mnt/mc00 - all works well. Of note - magic error when trying to boot ANY tested kernels from mc00. Works from mc01 though. Thanks Mega Man!!!
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I stripped my kernel from 3MB to 2MB, because I've seen similar problems when using initrd.gz. I was thinking, that the initrd was overwritten and need to be loaded to lower address. There is an error in my initrd patch. The initrd.gz is not protected against overwriting. After checking the Linux kernel code, I detected that the extracted initrd is CRC checked. Initrd is only used when CRC is correct. So there couldn't be any random runtime errors. There are only 2 possible things that can happen:
1. Initrd is overwritten and rejected by CRC check at startup.
2. Initrd is not overwritten and everything should work.

I've also seen that problems increase when I use XPADMAN instead of PADMAN. I got also errors when loading from hard disc. It seems that memory gets overwritten by IOP when init function of XPADMAN is called. There is no problem when padman.irx from Sony's RTE disc is used.
I believe Sony use the newer version from the DVD, because there is a bug in XPADMAN and PADMAN is too old.

Just try to strip your 3MB kernel using ee-strip.

I've done only few tests with memory cards, but it was always working. I will do some tests.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

I stripped my 3MB kernel to slightly less than 2MB. Thanks for the idea because now I use 1MB less on my memory card ;-) It still doesn't work with kloader, but I have no problems using your kernel. In fact, I don't think APA support is a problem in the kernel, because booting with your kloader/kernel I see a line during the boot messages (dmesg) showing hda:
then
[APA] hda1 hda2 hda3
the APA support is in the modules on the hard drive (ps2.h).

It is strange that a stripped kernel uses the same amount of memory as an unstripped kernel according to top. So what am I missing?

Your kernel loader 1.5 (ps2link embedded version) works great from mass. I finished my dillo-0.8.6-i18n-misc compile using my system booted from your bootloader, and it runs great in wmaker.

No errors noted other than known issues with sound, cd/dvd. Great work!
rafael2k
Posts: 18
Joined: Sun Jan 14, 2007 2:41 am

keyboard still not working in ps2 slim

Post by rafael2k »

hi megaman,
I tried your new loader version, and now the nice background image appears ok to me! - i'm using a ntsc console.

but some strange things happens:
the usb flash used in Action Replay to load the loader do not works inside the loader, but another usb flash I have acess works ok inside the loader, but not in Action Replay.

well, after booting the linux kernel w/ initrd, the same usb errors happens... as before.
so no keyboard.
I'll try to get some other usb keyboard to see what happens.

should I try another kernel?

thanks for the great advances!!

bye,
rafael diniz
rafael2k
Posts: 18
Joined: Sun Jan 14, 2007 2:41 am

could you put the network module inside initrd?

Post by rafael2k »

hi megaman,
can you put the kernel network interface module inside the initrd?
since the ps2 slim is w/ problems w/ the usb keyboard, i could try acessing it remotelly.

another thing, is possible to use the joystick inside linux?

bye,
rafael diniz
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

The action replay driver and the ps2sdk usb mass storage driver are different. I know that different devices are supported in each driver.

The network driver is already included in the kernel. I couldn't find a telnetd which is compatible to my initrd (I don't compiled the initrd). Initrd is based on:

http://playstation2-linux.com/files/dis ... t-1.tar.gz

I think you can check if the PCIC type has any influence (mentioned before in this thread). You need to enable hard disc and network in menu. Please try values 0 to 3.
rafael2k
Posts: 18
Joined: Sun Jan 14, 2007 2:41 am

still trying...

Post by rafael2k »

ok,
I tried to ifconfig eth0 in the initrd, but there is no eth0...
harddisk and network is enabled in the loader.
may be ps2 slim has a different network interface?

how about the usb support in linux - does it uses a wrapped ps2sdk usb driver
or a totally different driver, because the keyboard works ok inside the loader, but inside linux I just get errors.

I tried PCIC w/ values 0, 1, 2, and 3.
no difference.

another thing - can you post your kernel .config, sources and toolchain?

Thanks a lot!
Lets set up a ps2 linux site?
I can set something like
ps2.sarava.org
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

A frustrating 12 hours - I noted that your kernel has an imbedded ramdisk.gz, and loads an EIDE PIO-mode driver. I have tried to boot several kernels (2.4.17 from playstation2-linux.com, 2.21apa from the same, and xrlinux Blackrhino), none will get me to the prompt. I believe it has to do with your VMLINUX using the imbedded ramdisk.gz to then boot whatever initrd is selected from kloader. Since my kernels don't have an imbedded ramdisk, I don't know the kernel parameters to use to go to the proper root device. I am now using extra kernel parameters "ide=nodma" because I'm trying to avoid DMA issues with the hda device, and "root=/dev/ram0" as this seems a logical root device. What parameters or other changes did you implement to get the kernel from playstation2-linux.com to boot with kernelloader? When I use your 2.4.17 VMLINUX with your 2.2.1 Blackrhino-modified initrd.gz I get the prompt, and can even use sfdisk /dev/hda to make partitions. When I copied ps2fdisk to mc0:/BWLINUX I mounted, copied, and used it to create APA-partitions too. However, mke2fs /dev/hda kernel panicked under all test cases. mke2fs -S /dev/hda works, but that doesn't get the partition formatted. Any suggestions? I feel like I'm partitioning correctly, but the improper modules are loaded to get mke2fs working properly, and so I'm trying my own kernel/initrd combinations to see if I can get mke2fs working. Since I can't boot other combinations, I can't perform further mke2fs tests. Thanks for any help you can offer...
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I uploaded a new version. The new version is more stable and support initrd also for non patched kernels.

In earlier version I used a kernel patch for initrd support. The kernel I've uploaded was built using the instructions in the README of release 1.5. There is also described where I downloaded the sources and the toolchain. I don't embed the ramdisk.gz. I deactivated it by the patch.
There is no parameter to get the initrd. Initrd is detected at startup automatically. The initrd is not "/dev/ram0", it is "/dev/ram250".
I also see the mke2fs error. This is now working. I managed to install Blackrhino using initrd and a USB stick.
I believe most of the problems were caused by the iop heap allocation bug, which I have fixed.

You can avoid DMA issues by not loading "dmarelay.irx". The module is not required.

EDIT:I just detected that "dmarelay.irx" must be deactivated to load kernels which support DMA (e.g. Sony's original Linux 2.2).

sarava.org seems to be something like sourceforge.net. My internet connection to the site is slow. The site seems to be spanish. I would prefer sourceforge.net.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

Post by deba5er »

Thanks for taking the time to help me. I'm still learning quite a bit, and don't always understand what I read. Today I took a scratch hard drive, used Winhiip 1.76 to format/install as APA/PS2, then used your VMLINUX/INITRD.GZ and the ps2fdisk_0.9-3 from playstation2-linux.com (copied from mc0/BWLINUX to /sbin) to partition, then fsck.ext2 hda1, hda3 (had to mknod /dev/hda3 b 3 3 first), mkswap /dev/hda2, then ftp my .tgz linux backup from my original Linux install. After that I used kernelloader to boot my original mc0:/BWLINUX/vmlinux24, with initrd.gz disabled, and root=/dev/hda1.

All works fine in both Linux and HDL. Thanks for an open Linux on the PS2 - Incredible!
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

initial time/date on system

Post by deba5er »

To get around the initial Nov 1999 time/date on system, it was easy to compile and install the latest version of ntpd from source on the PS2 (openssl required first) - LDFLAGS=-ldl ./configure; make; make install Then vi /etc/ntp.conf for server and ntpdrift (google ntp.conf for working examples) then place "/usr/local/bin/ntpd -g -q" line in /etc/rc.d/rc.local

This adds only a couple seconds to the boot time, and prevents the time difference errors when extracting tar files.

I've made two installations thus far using a backup.tar.gz of a previous PS2-Linux installation and everything is working great. Let me know what testing you would like done next...or if you would like tar.gz's of precompiled packages for latest version openssl, openssh, libpng, zlib, wget, dillo-0.8.6-i18-misc, ntpd, xmms, blursk, etc.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

I've uploaded a file describing how to install Blackrhino on a hard disc using kernelloader.

http://mitglied.lycos.de/ps2dev/tutoria ... linux.html

I am interested if netbsd is working with my kernelloader, but I don't have the VGA cable. Did someone has this cable can tell me if netbsd is working?

ftp://ftp.netbsd.org/pub/NetBSD/arch/pl ... GENERIC.gz

You need to extract it with gunzip and then select it as kernel. I can only see a very high frequency on my TV screen.
melinko2003
Posts: 1
Joined: Fri Mar 07, 2008 2:16 am
Location: Phoenix, AZ

Hi

Post by melinko2003 »

I know on the coding end i cannot attribute alot in that aspect but i have a PS2 Model type SCHP 79001 Slim - NTSC - And am willing to test configurations and gather data if you could provide tools & kernels patches... Im pretty familiar with Linux 2.6.x.x but would like to get involved and help developement of the 2.4.x.x Kernel for the Slim line systems..

If outside hardware/software is required i probably have access to it or could get access to it.

Ive read through this set of Posts and the posts for 2.6.x.x and this project looks like it could go somewhere!
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

melinko2003, I need to know if USB is working on your slim PStwo. The latest kernelloader is more stable. Just use the kernel and the initrd on my web page.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

SCPH-39001 USA NTSC version works

Post by deba5er »

Your kernelloader works fine with SCPH-50001 (v9), SCPH-30001 (v3), and SCPH-39001 (v7).

This weekend I used your installation instructions for a from-scratch install (except replaced use of fdisk with ps2fdisk) on the SCPH-39001. No problems were found.

I did not see any responses to the use of the Netbsd kernel / VESA mode, so I have purchased the pieces necessary to mod/setup an old sync-on-green monitor I have. I'll have everything in hand by this weekend to test.

I really appreciate the work you've done (as does my girlfriend, who is now playing around in Linux because of your loader)!
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

It is nice to see somebody using it. I've got already 314 visits on my web page this month (12 days).
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Mega Man wrote: I am interested if netbsd is working with my kernelloader, but I don't have the VGA cable. Did someone has this cable can tell me if netbsd is working?

ftp://ftp.netbsd.org/pub/NetBSD/arch/pl ... GENERIC.gz

You need to extract it with gunzip and then select it as kernel. I can only see a very high frequency on my TV screen.
Sorry, I missed this somehow. The netbsd kernel doesn't work from your kernel loader (1.6) on my PS2. I get "Magic 0x00088b1f is wrong" as the error message.

I have a 30K1 v4 PS2 with the network expansion and a harddrive attached. I'm using the ID exploit to run uLaunchElf, which I then use to run kloader.elf from the USB stick. That runs fine and gets to the menu. I select the netbsd file as the kernel and then select run current config. Is there something else that needs to be done?
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

magic error

Post by deba5er »

I got a magic error originally too when loading one of my kernels off of the memory card. I over-wrote it and it worked. Try copying again and load the kernel from USB. As I haven't repeated the error, this could have been a corrupted copy.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Nope - still 0x00088b1f. I redownloaded it, verified the archive integrity, copied it to the USB stick, and verified the integrity on the USB stick. Boots the linux kernel from the same stick fine, so it's probably not the stick.

I love this loader... it's really nice. But it doesn't load that netbsd kernel. Not on my PS2 at least.
deba5er
Posts: 166
Joined: Mon Feb 04, 2008 2:01 pm

usb-storage question

Post by deba5er »

@J.F. - sorry, worth a shot. I'll try both the kit and kloader if I can get my VESA setup working this weekend and report back.

I like using my USB memory stick to transfer data. Do you use something similar after booting with kloader to access your USB memory stick?

Copy the 2.4.17-mvl21 directory into /lib/modules and then:

modprobe usb-storage
mount /dev/sda1 /mnt/sda1 -t vfat

Just wondering if this is tested or if I'm chancing a corrupt USB filesystem.
aeon
Posts: 3
Joined: Wed Mar 12, 2008 10:54 pm

USB HDD

Post by aeon »

Hi Mega Man,

I'm don't know nothing about development, I only wanna install Linux on my PS2. I have a SLIM model SCPH-79001, so I can't install a IDE HDD.

I can try to install Linux over a USB HDD, but I wanna know before if this can work.

Someone can answer me if I can install Linux with a USB HDD on a PS2 SLIM SCHP-79001?

PS.: I have a moded PS2.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Post by Mega Man »

J.F. wrote:I get "Magic 0x00088b1f is wrong" as the error message.
The magic are the first 4 bytes of the file. You don't have extracted the file. There is a command called "gunzip" on Linux which can unpack the file.
My loader can't start packed files. But when I think about it, it would be a nice feature.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Re: usb-storage question

Post by Mega Man »

deba5er wrote: Just wondering if this is tested or if I'm chancing a corrupt USB filesystem.
I tested reading and writing of USB memory sticks. It seems to be stable, but I don't load the module, because I compiled it into the kernel.
Mega Man
Posts: 260
Joined: Sat Jun 18, 2005 3:14 am
Contact:

Re: USB HDD

Post by Mega Man »

aeon wrote: Someone can answer me if I can install Linux with a USB HDD on a PS2 SLIM SCHP-79001?
rafael2k reported that USB is not working with the slim PSTwo. But the last version include fixes that could solve the problem. So I don't know if it is working.

EDIT: I detected that it is not possible to directly mount USB devices at startup (root=/dev/sda1). I need to debug it.
Post Reply