Writing BootManager using dd.
Hi, In ETH Oberon, BootManager can be written to a disk with these commands. Partitions.WriteMBR dev#0 BootManagerMBR.Bin ~ Partitions.FileToPartition dev#0 BootManagerTail.Bin 1 12 ~ I think of this as equivalent in Linux. dd if=~/BootManagerMBR.Bin of=/dev/sdx count=1 dd if=~/BootManagerTail.Bin of=/dev/sdx seek=1 count=12 Corrections? Tips? Thx, ... P.L. -- 48.7693 N, 123.3053 W tel: +1 604 670 0140
Hi Peter, be careful, in principle you are correct, but afaik this overwrites also the partition table (which is located in the last ? bytes of the boot sector, but I am not really sure about the number of bytes in the moment). As far as I found in the hurry, you need an bs=446 in addition to your parameters, see https://homepages.cwi.nl/~aeb/linux/disk/partition_types-2.html#ss2.5 Regards -- Bernhard -----Original Message----- From: peter@easthope.ca <peter@easthope.ca> Sent: Tuesday, July 6, 2021 1:25 AM To: oberon@lists.inf.ethz.ch Subject: [Oberon] Writing BootManager using dd. Hi, In ETH Oberon, BootManager can be written to a disk with these commands. Partitions.WriteMBR dev#0 BootManagerMBR.Bin ~ Partitions.FileToPartition dev#0 BootManagerTail.Bin 1 12 ~ I think of this as equivalent in Linux. dd if=~/BootManagerMBR.Bin of=/dev/sdx count=1 dd if=~/BootManagerTail.Bin of=/dev/sdx seek=1 count=12 Corrections? Tips? Thx, ... P.L. -- 48.7693 N, 123.3053 W tel: +1 604 670 0140
Hi Bernhard, On Di, 2021-07-06 at 11:08 +0000, Treutwein Bernhard wrote:
As far as I found in the hurry, you need an bs=446 in addition to your parameters, see https://homepages.cwi.nl/~aeb/linux/disk/partition_types-2.html#ss2.5
this is correct. A partition table entry occupies 16 bytes, and there are 4 of them. The last two bytes contain the "boot sector signature" (0x55, 0xAA). The total sector size is 512, so 512 - 4*16 - 2 = 446. Hellwig
participants (3)
-
Hellwig Geisse -
peter@easthope.ca -
Treutwein Bernhard