Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot the kernel directly off the optical disk drive #37

Open
1 of 3 tasks
frno7 opened this issue Dec 30, 2020 · 20 comments
Open
1 of 3 tasks

Boot the kernel directly off the optical disk drive #37

frno7 opened this issue Dec 30, 2020 · 20 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@frno7
Copy link
Owner

frno7 commented Dec 30, 2020

Explain on the wiki how to install Linux on a DVD, similar to #4 (comment) but with a 5.x kernel. A guide has now been written for creating a bootable DVD for PlayStation 2 Linux. Plan:

@frno7 frno7 added enhancement New feature or request help wanted Extra attention is needed labels Dec 30, 2020
@faissaloo
Copy link

I've created a basic tutorial that should work: https://github.com/frno7/linux/wiki/Creating-a-bootable-PS2-Slim-DVD

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

@faissaloo, perhaps we should make a note about what version of the Linux kernel the basic tutorial currently covers?

@faissaloo
Copy link

The tutorial should be version agnostic

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

Sure, but BOOT/VMLINUZ.GZ from the ISO must have some version? Something like this:

  1. Replace ./BOOT/VMLINUZ.GZ (Linux kernel version 2.x.y) with your version of vmlinuz.gz

Also, the Black Rhino distribution won’t run properly with 4.x and 5.x kernels, because it uses R5900 128-bit multimedia instructions (LQ, SQ, PEXTLB, PEXTLW and so on in for instance /lib/ld.so). MMIs aren’t currently supported, see issue #5. Linux 2.x kernels are not IEEE 754 compatible, unlike 5.x kernels, as explained in issue #3. So versions are quite important until we have sorted out the issues, at the very least.

The initial patch submission, as discussed with kernel maintainers regarding issue #1, will be limited to the o32 psABI. In this regard, the Black Rhino build is nonstandard.

@faissaloo
Copy link

faissaloo commented Dec 30, 2020

Oh sure, this tutorial isn't supposed to produce a Black Rhino iso, I've written it such that you replace/delete all the BlackRhino specific files. I've added some more detail now, let me know what you think. As long as this kernel can be booted with KernelLoader there should be no issues.

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

Thanks! I added a section Notes about R5900 Linux distributions and kernel versions to the guide. Last time I tried the Kernel Loader program it crashed when attempting to boot Linux 4.x and 5.x, so I assume that this will be a problem as well? In that case the kernel ought to be launched from wLaunchELF directly (as is usually done when launching 5.x kernels from a USB drive).

Eventually the kernel ought to be able to bypass even wLaunchELF and boot directly regardless of hardware state, but as noted in #4 we have a couple of initialisation issues to sort out first, starting with #9.

@faissaloo
Copy link

When it comes to launching directly, how do you handle passing kernel parameters? That's the main thing KernelLoader is for. I've added some information about what to do if you the disk to start a different ELF.

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

One more thing, I strongly suggest that the step 2 ought to be something like this:

  1. Verify that the downloaded 7z archive file has SHA256 xxx.

The URL itself doesn’t look particularly trustworthy, and one should always verify downloads anyway!

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

When it comes to launching directly, how do you handle passing kernel parameters? That's the main thing KernelLoader is for.

Oh, that’s rather easy. Simply enable CMDLINE_BOOL and set CMDLINE to whatever parameters you need in your kernel config:

config CMDLINE_BOOL
bool "Built-in kernel command line"
default n
help
For most systems, it is firmware or second stage bootloader that
by default specifies the kernel command line options. However,
it might be necessary or advantageous to either override the
default kernel command line or add a few extra options to it.
For such cases, this option allows you to hardcode your own
command line options directly into the kernel. For that, you
should choose 'Y' here, and fill in the extra boot arguments
in CONFIG_CMDLINE.
The built-in options will be concatenated to the default command
line if CMDLINE_OVERRIDE is set to 'N'. Otherwise, the default
command line will be ignored and replaced by the built-in string.
Most MIPS systems will normally expect 'N' here and rely upon
the command line from the firmware or the second-stage bootloader.
config CMDLINE
string "Default kernel command string"
depends on CMDLINE_BOOL
default ""
help
On some platforms, there is currently no way for the boot loader to
pass arguments to the kernel. For these platforms, and for the cases
when you want to add some extra options to the command line or ignore
the default command line, you can supply some command-line options at
build time by entering them here. In other cases you can specify
kernel args so that you don't have to set them up in board prom
initialization routines.
For more information, see the CMDLINE_BOOL and CMDLINE_OVERRIDE
options.

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

Additionally, as per #33 (comment), one can pass parameters to kernel modules in the initialisation scripts, like this:

modprobe ps2fb mode_option=1920x1080p@50 mode_margin=+13+0

The line above would load the Graphics Synthesizer frame buffer device driver and set the default video resolution to progressive 1920×1080 at 50 Hz, and then do some minor pixel adjustments as explained in:

/*
* Analogue devices are frequently a few pixels off. Use this mode_margin
* option to make necessary device dependent adjustments to the built-in modes.
*/
module_param(mode_margin, charp, 0);
MODULE_PARM_DESC(mode_margin,
"Adjust initial video mode margin as \"<-|+><dx><-|+><dy>\"");

Video modelines are very flexible with 5.x kernels, unlike 2.x kernels that don’t handle 1920×1080.

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

Some more: I think the guide should be renamed by omitting the word slim so that we have a general DVD guide (incidentally, slim has unfortunate connotations that would best to avoid).

Then a step 0 ought to be to review the PlayStation 2 Linux hardware model compatibility, and make sure that one has SCPH-7xxxx or possibly SCPH-900xx. I know that 2.x kernels are fiddly getting to work with various models. 5.x kernels should be much better at this, in the sense that they shouldn’t be possible to misconfigure for any particular model (that is, if it boots on one, it should boot on all).

I put the USB alternative in the header. Eventually we should to link to a USB guide there (and vice versa, have the USB guide link to the DVD dito).

@frno7
Copy link
Owner Author

frno7 commented Dec 30, 2020

Ah, regarding spelling: all other wiki pages spell out PlayStation 2 in the titles, with no abbreviation like PS2. The DVD guide ought to follow suit.

@faissaloo
Copy link

faissaloo commented Dec 30, 2020

I didn't even realise you could hardcode the kernel config. Thanks to your suggestion regarding verifying downloads I realised the download link I was using previous had truncated the file lol, so I've switched it to another site and added the SHA. I've also linked to the hardware compatibility for this kernel and fixed the abbreviations.

@frno7
Copy link
Owner Author

frno7 commented Dec 31, 2020

Thanks, @faissaloo! I did a few minor adjustments to the guide:

A couple of questions:

  1. Can the filename 9Zbm8Tdz4DvLXUGB.7Z be improved to something more intelligible? Also having a version number, for instance?
  2. How does 9Zbm8Tdz4DvLXUGB.7Z relate to the variants at PS2 Live Linux DVD v3? Does it come from there? Is it somehow repackaged?

@faissaloo
Copy link

faissaloo commented Dec 31, 2020

The filename was set by the site I uploaded to, the ISO in it is based on ps2linux_live_v3_pal_small_no_modchip.7z. I don't know that PAL vs NTSC refers to anything that we aren't replacing. The changes made are as follows:
I replaced its VIDEO_TS/ with the the FreeDVDBoot payload whose ELF in turn has been replaced with wLaunchELF+autostart and LNCHELF.CNF is added to configure it.

@frno7
Copy link
Owner Author

frno7 commented Dec 31, 2020

Great! Would you like to update the guide with a (small) note on these particular changes compared with ps2linux_live_v3_pal_small_no_modchip.7z, and add a link to the original site?

@faissaloo
Copy link

Done, how's that?

@frno7
Copy link
Owner Author

frno7 commented Dec 31, 2020

@faissaloo, nice, thank you very much!

@deba5er
Copy link

deba5er commented Sep 3, 2021

9Zbm8Tdz4DvLXUGB.7Z link no longer works. Would you be able to renew or update?

@frno7
Copy link
Owner Author

frno7 commented Sep 3, 2021

@deba5er, see also #4 (comment). I think download issues with these Linux 2.x images ought to be a separate issue, as they’re tangential to the the topic of this one. @deba5er, could you create a new issue and ping @faissaloo about it, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants