grub icon indicating copy to clipboard operation
grub copied to clipboard

Need to get dword values from MBR (LBA0)

Open steve6375 opened this issue 5 years ago • 3 comments
trafficstars

Is read_dword supported? Help text at https://a1ive.github.io/grub2_cmd_zh.html suggests read_byte, read_word, read_dword, write_bytes I want to get dword values from the MBR of a disk (hd0)0+1. then use expr x+y to add two values then use test x -ge y etc. to check values. Any idea how to do this? I can get the bytes via hexdump but this returns a string of simple bytes not a dword value. Any help appreciated.

steve6375 avatar Feb 25 '20 18:02 steve6375

read_byte, read_word, read_dword, write_bytes

These commands are used to read /write memory.

I want to get dword values from the MBR of a disk (hd0)0+1. then use expr x+y to add two values then use test x -ge y etc. to check values.

What do you want to do?

a1ive avatar Feb 25 '20 23:02 a1ive

I want to check that the partitions in the partition table are in order and do not overlap after switching in a .imgPTN file.

steve6375 avatar Feb 26 '20 00:02 steve6375

I don't think we could handle dword in grub2 scripts (or other scripting languages).

a1ive avatar Feb 26 '20 04:02 a1ive