Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

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

Open
steve6375 opened this issue Feb 25, 2020 · 3 comments
Open

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

steve6375 opened this issue Feb 25, 2020 · 3 comments

Comments

@steve6375
Copy link

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
Copy link
Owner

a1ive commented Feb 25, 2020

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
Copy link
Author

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
Copy link
Owner

a1ive commented Feb 26, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants