[Oberon] PO2013 - SD Image Tool

Paul Reed paulreed at paddedcell.com
Sat May 23 18:35:52 CEST 2020


Hi Tomas,

> Trying to compress [the disk image of] my first build.
...
> 0008eff0  00 00 e0 af 04 00 e0 a0  08 00 e0 a1 10 00 c0 8d  
> |................|
> 0008f000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
> |................|

Just an observation: that last sector seems to have truncated code in 
it, code would normally end with a RISC5 B LNK (0C700000F) instruction.  
Maybe ok if this was garbage in memory, before a buffer was re-used for 
something else.


> I may need to add 0x00 padding to align on 1K boundary, right?

No need if the file is always written in multiples of 1K.  A virtual 
machine would probably do that if it's emulating Kernel.PutSector.

> Last sector used?
> 
> $ echo $(( (0x8f000 + 1023) / 1024 ))
> 
> EDIT I am about to do this.
> $ dd if=RISC5.FS of=RISC5cmpr.FS bs=1k count=572

That seems ok but fiddly and error-prone.  As Michael said, try zipping 
or gzipping both images and see if it's worth the extra effort of 
truncation, especially if it's just a backup.

A better way might be to find the last allocated sector while the system 
is still running: Kernel.AllocSector takes a hint, and returns the next 
free sector after the hint, as a way of reducing fragmentation.  This 
feature could be abused to get a map of allocated sectors.

Cheers,
Paul


More information about the Oberon mailing list