[Oberon] Oberon] FPGA - Save / Restore OBERON.FS
eas lab
lab.eas at gmail.com
Fri Apr 14 16:09:36 CEST 2017
$ dd -h
BusyBox v1.24.2 (2016-05-16 13:28:30 UTC) multi-call binary.
Usage: dd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N]
[seek=N] [conv=notrunc|noerror|sync|fsync]
--------------------
Do:
ls -l OBERON1.FS
to confirm the existence of OBERON1.FS in THAT directory
[don't call it a folder like office-girls do] Follow this example:-
Make a file of few bytes:
echo "What count should I use?" > SmallTextFile
See what the size is: ls -l SmallTextFile
-rw-r--r-- 1 tc staff 25 Apr 14 15:17 SmallTextFile
See the individual bytes, of totol 25, that you want to cut-off:
cat SmallTextFile | hexdump -C
00000000 57 68 61 74 20 63 6f 75 6e 74 20 73 68 6f 75 6c |What count shoul|
00000010 64 20 49 20 75 73 65 3f 0a |d I use?.|
This is an example of piping/functional-programming, that I have been, and will
continue to harp-on-about!
Let's cut off the 1st 5chars and the tail to get only the 5chars of "count";
dd if=SmallTextFile of=SmallERTextFile skip=5 count=5
transfers 0 bytes; perhaps because the default <BlockSize> is 512,
but then why the previous write-25-bytes?
dd if=SmallTextFile of=SmallERTextFile bs=1 skip=5 count=5
cat SmallERTextFile | hexdump -C
00000000 63 6f 75 6e 74 |count|
I didn't mention possible <sudo problems>.
$ dd if=/dev/sdc of=OBERON1.FS bs=1024 skip=262145 count=$((65*1024))
That's one-line, including count=$((65*1024)),
but I'm not sure that the <64K> will be correctly handled.
Best confirm by the simplest method, before starting to optimise.
Oh!! Shouldn't it have been 64*1024 ?!
On 4/13/17, Tomas Kral <thomas.kral at email.cz> wrote:
> Hi,
>
> EDIT, at the end
>
> Reading some earlier post by Paul Read, I look for `dd' syntax to save
> and restore my work on uSD card.
>
> Providing
> uSD card is formatted as 256MB FAT + 65MB OBERON.
>
> Restore my work indexed as `1' may work like this,
> $ dd if=OBERON1.FS of=/dev/sdc bs=1024 seek=262145
>
> By how about saving the work first,
> $ dd if=/dev/sdc of=OBERON1.FS bs=1024 skip=262145 count=???
>
> What count should I use?
> `System.Watch' may give a clue, but does not seem exact.
>
> EDIT, correction
>
> I could also use a fixed value of the whole 65MB Oberon partition, but
> not sure if below is correct
> $ dd if=/dev/sdc of=OBERON1.FS bs=1024 skip=262145
> count=$((65*1024))
>
> Reading `dd' manual, allows for suffixes,
> $ dd if=/dev/sdc of=OBERON1.FS bs=1K skip=265M
> count=65M
> Correct?
>
> Many thanks.
> Tomas
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
More information about the Oberon
mailing list