1*2e0bf311Sandvar/* $NetBSD: README,v 1.2 2021/08/17 22:00:31 andvar Exp $ */ 2c1c742b4Sfredette 3c1c742b4SfredetteThe sun bootblocks are split into two parts: a small 1st-level program that 4c1c742b4Sfredettegets written right after the superblock in a partition (and is hence limited 5c1c742b4Sfredettein size to SBSIZE - DEV_BSIZE bytes), and a 2nd-level program that resides 6c1c742b4Sfredettein the filesystem proper. 7c1c742b4Sfredette 8c1c742b4SfredetteThe 1st-level program is loaded into memory by the PROM. It loads the second 9c1c742b4Sfredettestage program from a set of filesystem block numbers that are hard-coded 10c1c742b4Sfredetteinto it by the `installboot' program. The prototype code for the 1st-level 11c1c742b4Sfredettebootblocks are in `bootxx'. 12c1c742b4Sfredette 13c1c742b4SfredetteThe 2nd-level program (`ufsboot') is normally installed in the root FS 14c1c742b4Sfredetteas `/ufsboot'. It uses the device drivers in the PROM and the stand-alone 15c1c742b4Sfredettefilesystem code in `libsa.a' to locate and load the kernel. 16c1c742b4Sfredette 17c1c742b4SfredetteUse the following command to install the 1st-level bootblocks in the 18c1c742b4Sfredetteroot filesystem (on `sd0a') using the file `/boot' as the second level 19c1c742b4Sfredetteboot program: 20c1c742b4Sfredette 21c1c742b4Sfredette mount /dev/sd0a /mnt 22c1c742b4Sfredette cd /usr/mdec 23c1c742b4Sfredette cp -p ufsboot /mnt/ufsboot 24c1c742b4Sfredette sync ; sleep 1 ; sync 25c1c742b4Sfredette ./installboot -v /mnt/ufsboot bootxx /dev/rsd0a 26c1c742b4Sfredette 27c1c742b4SfredetteThe above only works with securelevel <= 0 (see init.8 manual). 28c1c742b4Sfredette 29c1c742b4SfredetteStatus: 30c1c742b4Sfredette 31c1c742b4Sfredettenetboot works. 32c1c742b4Sfredette 33c1c742b4Sfredettebootxx, installboot are tested and working. It would be nice if 34c1c742b4Sfredetteinstallboot would find the inumber for the 2nd stage boot program 35c1c742b4Sfredettewithout having the filesystem mounted so this command can work 36*2e0bf311Sandvarwith securelevel==1 (the default). Doing this requires adding 37c1c742b4Sfredettecode to read and do a directory lookup in the root... 38c1c742b4Sfredette 39