a1ive / grub

Fork of GRUB 2 to add various features.
GNU General Public License v3.0
138 stars 38 forks source link

Need to get dword values from MBR (LBA0) #44

Open steve6375 opened 4 years ago

steve6375 commented 4 years ago

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.

a1ive commented 4 years ago

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?

steve6375 commented 4 years ago

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

a1ive commented 4 years ago

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