Hi, Thinking about a tool, outputting files to RISK.img file. Could run on System-V (Overon07 code) or RPI (c code). Image.Create - initialise empty image with header Image.Add Modules.bin (Inner Core), Viewers.rsc, .., System.rsc, Oberon.rsc ~ This would lead to a compact image <= 64M I expect a difficult part updating system directory info. Looking for hints and examples, I could then code on my own, if not too difficult, and not silly idea. -- Tomas Kral <thomas.kral@email.cz>
Hello, Am 16.05.2020 um 11:43 schrieb Tomas Kral:
Thinking about a tool, outputting files to RISK.img file. Could run on System-V (Overon07 code) or RPI (c code).
When running such an image tool inside the Oberon filesystem, you have to keep in mind that this filesystem has a maximum file size of about 3MB. This is sufficient for small images, and if you do not care too much about performance of large files (as they are rare), it can be quite easily lifted: <https://github.com/schierlm/Oberon2013Modifications/tree/master/RemoveFilesizeLimit>
Image.Create - initialise empty image with header Image.Add Modules.bin (Inner Core), Viewers.rsc, .., System.rsc, Oberon.rsc ~
I expect a difficult part updating system directory info.
When running it inside the Oberon system, you can save a lot of work if you use copies of FileDir and Files (and call them ImageFileDir and ImageFiles), so you don't have to implement the logic yourself. ImageKernel could then look like this (this has more functionality than what you need): <https://github.com/schierlm/OberonEmulator/blob/4ccd9174124e7a42546ff6946277ca8869ae0ddf/Oberon/ImageKernel.Mod.txt> And ImageTool which can initialize the filesystem and add files would look like this: <https://github.com/schierlm/OberonEmulator/blob/4ccd9174124e7a42546ff6946277ca8869ae0ddf/Oberon/ImageTool.Mod.txt> This does not cover adding the inner core, as I added support to my boot linker to write the inner core into a filesystem image, but since this requires just a copy loop, it could be easily added. If you prefer to do it on your Raspberry Pi, you may want to have a look at Peter's Project Norebo at <https://github.com/pdewacht/project-norebo>.
Looking for hints and examples, I could then code on my own, if not too difficult, and not silly idea.
Not too silly. Still the file size limit may limit its uses.
This would lead to a compact image <= 64M
I am not sure where your figure of 64MB comes from. The default filesystem offset requires a padding of 256MB (+512 bytes), so if you include the padding, the image would always be larger than 256MB. If you look at existing filesystem images that do not include the padding (e.g. those bundled with Peter's emulator), they are about 900-1000 KB, so far away from 64 MB (and they include source code). A minimal image I built some time ago (without compiler or source code) weighs about 180 KB. Nevertheless, if your main goal is to "shrink" images you have (after you deleted files you don't need), a slightl less silly idea (that is not limited by the maximum file size, and can be easily run periodically) would be to write a defragmenter. I did it here: <https://github.com/schierlm/Oberon2013Modifications/tree/master/DefragmentFreeSpace> It will first increase the image size by the amount of used space (by creating copies of all files), but then it will move them all to the beginning and write an end marker to the image so that you can cut off the unused part. Regards, Michael
Excellent, it was already addressed. I was always curious what people around NW did back in 2013 to make original image.
I am not sure where your figure of 64MB comes from. The default filesystem offset requires a padding of 256MB (+512 bytes)
Yes, the padding I forgot, but I believe Oberon FS itself is 64MB. The one presented PO2013. But I think the padding is 256K, right? -- Tomas Kral <thomas.kral@email.cz>
Hello, Am 16.05.2020 um 14:53 schrieb Tomas Kral:
Excellent, it was already addressed. I was always curious what people around NW did back in 2013 to make original image.
Probably crosscompiling and building it on another Oberon system. The fact that the extensions for .rsc and .smb are different from .Obj and .Sym makes this easier.
I am not sure where your figure of 64MB comes from. The default filesystem offset requires a padding of 256MB (+512 bytes)
Yes, the padding I forgot, but I believe Oberon FS itself is 64MB. The one presented PO2013.
The sector bitmap in Kernel.Mod limits the usable space of the filesystem to 64 MB (You can increase it of course if you need). So, it is more like a "maximum size". Apart from that, the filesystem itself can grow into the gigabytes (assuming you have enough RAM for the sector bitmap).
But I think the padding is 256K, right?
Nope. It should provide space for a FAT filesystem, to make the SD card usable for transferring files. And 256 KB would be even small for a FAT filesystem (that is even smaller than a 360 KB floppy). Regards, Michael
On Sat, 16 May 2020 15:07:58 +0200 Michael Schierl <schierlm@gmx.de> wrote:
Nope. It should provide space for a FAT filesyste
Possibly does not have to, looking at my humble backup/restore tool. I just skip or seek past the FAT (256*1024K+1), and use 64MB only. pi@raspberrypi:/usr/src/oberon/img $ ls -sh 424K RISC.FS <=== original 66M RISC1.FS <=== my backups 66M RISC2.FS 66M RISC3.FS 65M RISC4.FS But you are right, it can only be used as OBERON.FS, cannot mount on as FAT or EXT4, through USB port. Perhaps if Linux mount people added Oberon FS then yes. I would like to be close to original size, as I never fill the whole 64MB FS, but I store it with dd. -- Tomas Kral <thomas.kral@email.cz>
Hi Tomas, On Sa, 2020-05-16 at 15:33 +0200, Tomas Kral wrote:
But you are right, it can only be used as OBERON.FS, cannot mount on as FAT or EXT4, through USB port. Perhaps if Linux mount people added Oberon FS then yes.
this you can do yourself, with a bit of programming, alas, in C/C++... :-) If you are interested, take a look at the "fuse" filesystem library: https://github.com/libfuse Regards, Hellwig
Michael, Hellwig, Thank you for the input. Not sure I am capable of extending fuse lib, as I usually tend to code only simple tasks. Will start with something small getting basic understanding of OBERON.FS and then see.. -- Tomas Kral <thomas.kral@email.cz>
Am 16.05.2020 um 15:33 schrieb Tomas Kral:
On Sat, 16 May 2020 15:07:58 +0200 Michael Schierl <schierlm@gmx.de> wrote:
Nope. It should provide space for a FAT filesyste
Possibly does not have to, looking at my humble backup/restore tool. I just skip or seek past the FAT (256*1024K+1), and use 64MB only.
256*1024K = 256M and not 256K :-)
pi@raspberrypi:/usr/src/oberon/img $ ls -sh
424K RISC.FS <=== original 66M RISC1.FS <=== my backups 66M RISC2.FS 66M RISC3.FS 65M RISC4.FS
Unlike the emulator, the real thing does not keep track which sectors have ever been written to, so if you want to make it simple, you have to copy the maximum size, which is 64 MB. If you would like to shrink your images, you can also add a command to Kernel.Mod which iterates over the sector map and overwrites every unused sector with 0 bytes. I believe this is a simple task that you are capable of doing, certainly easier than doing a full defragmentation. Once you ran that command, you can then cut off the image after the last non-empty sector. And you will notice if you compress the image that it compresses a lot better (as all those zeroes compress really well).
But you are right, it can only be used as OBERON.FS, cannot mount on as FAT or EXT4, through USB port. Perhaps if Linux mount people added Oberon FS then yes.
There are efforts by Charles Perkins to add such a driver, you can see the progress at <https://github.com/io-core/obfs>. I never used it so I am unsure about the status (whether it even works). When I want to get all the files in an image to the host (and do not want to use HostFS for that), I usually copy a file list out of the emulator and feed that to PCLink to retrieve all the files.
I would like to be close to original size, as I never fill the whole 64MB FS, but I store it with dd.
Then probably you should use a different tool :-) https://unix.stackexchange.com/q/416767/330045 Regards, Michael
Thomas, Michael, I did in fact write a fuse filesystem for the oberon fs into my go emulator so that I could copy files into and out of a disk image from linux... it worked, mostly. I learned a lot from that. I wouldn't try to use it as is, it's too much of a mess but it could be instructive for someone who wants to do it more cleanly. My current effort is to take the basic logic from that and make a Linux file system kernel module in C. Combining that with a QEMU emulator of the RISC5 machine would be sweet, I think. Chuck On Sat, May 16, 2020 at 7:54 AM Michael Schierl <schierlm@gmx.de> wrote:
Am 16.05.2020 um 15:33 schrieb Tomas Kral:
On Sat, 16 May 2020 15:07:58 +0200 Michael Schierl <schierlm@gmx.de> wrote:
Nope. It should provide space for a FAT filesyste
Possibly does not have to, looking at my humble backup/restore tool. I just skip or seek past the FAT (256*1024K+1), and use 64MB only.
256*1024K = 256M and not 256K :-)
pi@raspberrypi:/usr/src/oberon/img $ ls -sh
424K RISC.FS <=== original 66M RISC1.FS <=== my backups 66M RISC2.FS 66M RISC3.FS 65M RISC4.FS
Unlike the emulator, the real thing does not keep track which sectors have ever been written to, so if you want to make it simple, you have to copy the maximum size, which is 64 MB.
If you would like to shrink your images, you can also add a command to Kernel.Mod which iterates over the sector map and overwrites every unused sector with 0 bytes. I believe this is a simple task that you are capable of doing, certainly easier than doing a full defragmentation.
Once you ran that command, you can then cut off the image after the last non-empty sector. And you will notice if you compress the image that it compresses a lot better (as all those zeroes compress really well).
But you are right, it can only be used as OBERON.FS, cannot mount on as FAT or EXT4, through USB port. Perhaps if Linux mount people added Oberon FS then yes.
There are efforts by Charles Perkins to add such a driver, you can see the progress at <https://github.com/io-core/obfs>. I never used it so I am unsure about the status (whether it even works). When I want to get all the files in an image to the host (and do not want to use HostFS for that), I usually copy a file list out of the emulator and feed that to PCLink to retrieve all the files.
I would like to be close to original size, as I never fill the whole 64MB FS, but I store it with dd.
Then probably you should use a different tool :-)
https://unix.stackexchange.com/q/416767/330045
Regards,
Michael -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Tomas,
Excellent, it was already addressed. I was always curious what people around NW did back in 2013 to make original image.
Prof. Wirth built the system by meticulously transferring everything across the RS232 link, using a special Inner Core imported by a simple command interpreter on the RISC5 called Oberon0. See section 14.1 of the book: https://inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf Since this process depended heavily on another Oberon system on a host computer, I made some rather hacky cross-tools to build a downloadable SD-card image for projectoberon.com. I explained some of the (mainly defensive) rationale for the format of the RISC.img image in a previous post: http://lists.inf.ethz.ch/pipermail/oberon/2016/008881.html HTH, Paul
Hi I never used this serial link stuff. No Oberon-0, no PClink... Much too much hassle. My build process is built around a module called ISO.Mod; this module writes an ISO image that can be burnt onto the SD card. With ISO - I can copy Oberon files from and to the disk image. - I can look at the Oberon directory in the disk image - I can write the Oberon boot sector - I can look at the MBR s needed. Basically, what System does but on the ISO disk image br Jörg Am 16.05.20, 15:41 schrieb "Oberon im Auftrag von Paul Reed" <oberon-bounces@lists.inf.ethz.ch im Auftrag von paulreed@paddedcell.com>: Hi Tomas, > Excellent, it was already addressed. I was always curious what people > around NW did back in 2013 to make original image. Prof. Wirth built the system by meticulously transferring everything across the RS232 link, using a special Inner Core imported by a simple command interpreter on the RISC5 called Oberon0. See section 14.1 of the book: https://inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf Since this process depended heavily on another Oberon system on a host computer, I made some rather hacky cross-tools to build a downloadable SD-card image for projectoberon.com. I explained some of the (mainly defensive) rationale for the format of the RISC.img image in a previous post: http://lists.inf.ethz.ch/pipermail/oberon/2016/008881.html HTH, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (6)
-
Charles Perkins -
Hellwig Geisse -
Jörg -
Michael Schierl -
Paul Reed -
Tomas Kral