Compressed ROM images
Steve Revill (20) 1361 posts |
Email me at info@riscosopen.org and I can send it you that way. |
Chris Hall (132) 3554 posts |
On a related note, I got the “Live RISC OS” ROM build working on a BeagleBoard – it boots entirely from a disc image in ResourceFS, with temp files held in RAMFS. This is great, but the ROM is 28MB in size and takes a bleedin’ long time to load! Linux also takes ages to load. Is there a simple way to put something on the screen quite quickly that will give the user something to look at? Even just a coloured background with ‘Loading RISC OS’ would do. A simple progress bar would be even better. The user will be fooled into thinking that something important and time consuming is being done to prepare the computer for use rather than just a slow SD card interface doing something simple and quick but taking forever! All problems are also opportunities. I have 256Mbytes NAND flash on my Beagleboard XM/ARMini (it was a series A board) and so could easily make my machine boot very quickly. This gives me a thought. How easy would it be to create a 16Mbyte plug-in ROM for the Raspberry Pi (don’t know what headers are available on that board). I presume that is too difficult. So there’s a commercial opportunity here – get the uboot/fatload bit speeded up and offer users a quicker booting RISC OS at a price. Once you get into something that is not shipped on the SD card with the RPI then it is obviously simpler just to sell a bootable native RISC OS pen drive. A special one intended for the RPI should offer the option for the user to put a plain ROM image on the SD card in place of the large image containing the boot structure. Dare I suggest therefore that the start up banner could say ‘if you want RISC OS to boot more quickly then purchase a native ROOL pendrive’. An advert, no less. |
Jeffrey Lee (213) 6048 posts |
Possibly. You can put memory read/write commands in u-boot scripts, so it would be possible to create a script which programs the display controller for a standard mode (e.g. 640×480 or 800×600) and then loads an image for it to display. However I’m not sure how compatible it would be with all the different beagleboard revisions – one of the things that often gets changed when they revise the board is the way that the power to the DVI interface is controlled. So I think that if we want to get serious about reducing boot times or showing splash screens then I think the only way to do it would be to work on improving the u-boot source.
I guess that would be possible as well, if you were to split the ‘live’ image up into several chunks and load new progress bar images inbetween each chunk. (Or much easier if we were working with the u-boot source)
From what I’ve read, I don’t think the memory bus is exposed on any of the expansion headers, so I don’t think this would be possible.
Remember that u-boot is GPL. You can sell it, but anyone who buys it has the right to request a copy of the source code and release their own version for free. So you’d get one or two sales and then everyone would switch to using the free version. |
Theo Markettos (89) 919 posts |
The BCM2835 on RPi has (I assume) a first-stage bootloader in ROM sufficient to boot the GPU from a firmware image stored on SD, and the GPU bootstraps the ARM. It doesn’t use u-boot, and the code for the multi-stage boot is all from Broadcom so there’s no source. I’ll see if I can try padding out a jumbo Linux kernel and seeing how long that takes to boot. |
Steve Revill (20) 1361 posts |
Theo: at present, our “Live RISC OS” ROM is 20MB but this seems likely to grow towards 32MB as we add third party components into the ‘disc’ image. |
Jeffrey Lee (213) 6048 posts |
Steve: You may have thought of this already, but remember that with the current ROM build system there’s a hard limit of 32MB on the ROM size, due to the range of the B/BL instructions (which C modules would be using for SCL static linking). So don’t go too crazy with adding extra components to the image :-) In the future I guess we could allow for bigger images by moving the ResourceFS data blob to the end of the ROM image, past all the code sections. |
Steve Revill (20) 1361 posts |
Indeed. 32MB was our hard limit. Also, that’s the max size for the FAT12 partition (IIRC) so we’d likely stop short of there to ensure there’s a bit of room for the other files. |
Chris Hall (132) 3554 posts |
On a related note, I got the “Live RISC OS” ROM build working on a BeagleBoard – it boots entirely from a disc image in ResourceFS, with temp files held in RAMFS. One possibility is to load the rom and the contents of ResourceFS separately [the CMOS setting determining the boot drive but the booting process deciding whether to spend the time fatloading a large resourceFS from the SD card). Hence the SD card contents (the boot process and the file ‘cmos’) determining the set up. The purpose of having everything for a full boot present on the SD card is (AFAIK) for the RPI user who has not yet committed to RISC OS sufficiently to get a RISC OS bootable pen drive fitted. A sort of omni-present RISC OS to tempt users to use it. Things like network settings may need to be adjusted once and having ‘riscos’ and ‘resourcefs’ fatloaded separately from the SD card allows the user to alter the boot image (by altering ‘resourcefs’ on the SD card) to suit personal preference. Presume CMOS RAM on the RPI will have to be a file ‘cmos’ on the SD card and a ‘!WriteCMOS’ utility in the boot image within ResourceFS? Network settings are probably the most obvious candidate for needing tweaking but being tucked away in ResourceFS where the user will not be able to alter them. |
Chris Hall (132) 3554 posts |
Possibly. You can put memory read/write commands in u-boot scripts, so it would be possible to create a script which programs the display controller for a standard mode (e.g. 640×480 or 800×600) and then loads an image for it to display. However I’m not sure how compatible it would be with all the different beagleboard revisions This comment about putting something on the screen was made with only the Raspberry Pi in mind, not the Beagleboard. It is the potential volume of the RPI and the possibility of attracting new users that would make an attractive and tempting user interface worth investing effort and the key time is when trying RISC OS for the first time. You only get one chance to make a first impression!! |
Trevor Johnson (329) 1645 posts |
So I think that if we want to get serious about reducing boot times or showing splash screens then I think the only way to do it would be to work on improving the u-boot source.The BCM2835 on RPi […] doesn’t use u-boot, and the code for the multi-stage boot is all from Broadcom so there’s no source. (For systems using u-boot) I don’t know where this Pandaboard project is, but hasn’t this already been looked at? [Edit: There’s also barebox (link to docs saying OMAP supported).] |
Theo Markettos (89) 919 posts |
Terribly inaccurate timings with RPi Linux from release of reset button to Linux penguin:
SD card a 2GB MMAGF02GWMCU (freebie from Terasic), reading via dd bs=1048576 to /dev/null on Linux in a USB reader says:
For comparison, a RPi Debian distro takes 24.4s to boot to a login prompt on the same SD card (which has a pretty high latency and so isn’t great for being used as an ext3 filesystem). (Error of these measurements at least a second either way) |
Jeffrey Lee (213) 6048 posts |
I’ve now got a working ROM compression system, supporting the squeeze & zlib algorithms. Some quick stats:
In a day or so I’ll add some timing code to the startup sequence and try booting the live image to see exactly how long things are taking and how much of a difference the compression makes. At the moment it’s only the OMAP HAL that I’ve modified to support compressed ROM images. Adding support to the other HALs should be pretty easy, but the softload & romflash tools still need updating to cope with compressed images. I also need to make the ROM compressor add a checksum to the images in order to keep the Iyonix HAL happy. |
Jess Hampshire (158) 865 posts |
Will there be a version of this for IOMD? This would probably be the only way that RO 5 could be tried easily on an in-use Risc PC. (Until partion support is added). |
Theo Markettos (89) 919 posts |
Just as an aside, Linux has just mainlined Google’s Snappy compression, which claims to do 500MB/s decompress and 250MB/s compress, on a single core of an i7, 10x faster than zlib but with a 20-100% size penalty. It’s in C++, but doesn’t look much work to rework to plain C. BSD licence. |
Jeffrey Lee (213) 6048 posts |
Some timings for booting the OMAP live image on a BB-xM:
For the compressed image, relevant timings are:
The timings were taken using a 32kHz system timer, and were repeated twice for extra accuracy. The only thing which wasn’t measured this way was the ‘time to functional desktop’, where I just relied on !Alarm’s second count. A few extra notes:
|
Trevor Johnson (329) 1645 posts |
Possibly. How does that fit in with bootenv=boot.scr? |
Steve Revill (20) 1361 posts |
Great work, Jeffrey! This is all looking like worthwhile changes. I reckon there’s the possibility of getting RISC OS to boot from power-on in under 40 seconds – towards 30 seconds. That’d be fantastic. Which reminds me, I (or someone) should look at the DHCP module – it’s bad enough that it stops the boot sequence while waiting for the DHCP response, but it’s even worse that it sits there for bleedin’ ages if none is forthcoming. In an ideal world, the Live RISC OS image would come pre-configured with the right Ethernet module(s), AutoSense files and network stack config set up to DHCP. That’d be the right answer for most people but you don’t want RISC OS to fail to boot because of it… |
Keith Dunlop (214) 162 posts |
That would be very cool. What would be even better is that if it can’t find a DHCP server it could revert to an IP address that you could set manually in Configure. |
Steve Revill (20) 1361 posts |
I’m not promising anything because there are other, higher priority things for me to look at, but it would be nice… :) |
Jess Hampshire (158) 865 posts |
> What would be even better is that if it can’t find a DHCP server it could revert to an IP address that you could set manually in Configure. Or use the same system windows does, if no such address has been configured. |
Chris Hall (132) 3554 posts |
Some timings for booting the OMAP live image on a BB-xM: I have improved on this slightly as I have a series A Beagleboard XM ARMini with 256Mbytes NAND flash as well as 512Mbytes RAM. By issuing the commands:
I have got the time down as follows (using riscos 518_rc2 with hardware CMOS RAM): total time to RISC OS beep 27 sec, desktop at 1:10 (the network takes a little while to set up). However even loading from NAND flash it takes 3.5s to load the 4Mbytes RISC OS ROM image. |
Chris Hall (132) 3554 posts |
It strikes me that one way forward for the Rapsberry Pi is to start up in Noboot, language=BASIC. That should get the start up time to about 30 seconds. Also (hopefully) we can load an image into memory and get the DVI interface working to display it even earlier. Then we can use the ‘TWIN’ command (which from BASIC attempts to do a ‘*’ command *TWIN) to do the boot – we can even make this make sense as the command ‘TWIN’ would then be starting up the ‘alter ego’ a RISC OS desktop! The advantage of this approach is that the Raspberry Pi would then start up looking almost exactly like a BBC Model B computer – but with a bit more memory. How about: RISC OS 256MB |
Trevor Johnson (329) 1645 posts |
ISTR reading something on the RPi forum about booting to the Linux command line rather than GUI. Your idea fits in very well with this. |
Martin Hansen (393) 56 posts |
Chris, That’s such a cool retro idea. The great thing is, BBC Basics already in the ROM, so it’s easy to do. I’ll stick a link to your post on RISCOScode so others can find there way here and comment if they wish to. Regards, Martin. http://www.RISCOScode.com |
WPB (1391) 352 posts |
It is a cool idea. I wonder how many people’s memories that would jog! How many people’s fingers would, involuntarily, type: 10 PRINT "You smell!" 20 GOTO 10 ;) On a more serious note, and probably showing my ignorance, wouldn’t *DESKTOP do the job of getting you into the desktop rather than hacking something onto “TWIN”? |