diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2019-03-03 13:18:58 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2019-03-03 13:18:58 +0100 |
commit | 66c875209a9b85fd80875f44a3ae5b92548639ba (patch) | |
tree | 1614c381adc4e2f8bd74b1a1713d2164d3003ac5 /extractHintergrund.py | |
parent | 2788bf237014af5c6eece0190c7f73e4a1968290 (diff) | |
download | eumel-tools-66c875209a9b85fd80875f44a3ae5b92548639ba.tar.gz eumel-tools-66c875209a9b85fd80875f44a3ae5b92548639ba.tar.bz2 eumel-tools-66c875209a9b85fd80875f44a3ae5b92548639ba.zip |
The script added a bogus/empty page at offset 0x600, since only three
instead of four entries of the first page table were skipped.
To make sure offsets are correct, add the first page (not stored on
Hintergrund) to the output as well. FILE dataspace conversion can skip
this page with `--skip 1`.
Diffstat (limited to 'extractHintergrund.py')
-rwxr-xr-x | extractHintergrund.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/extractHintergrund.py b/extractHintergrund.py index 8f178a0..5795d8d 100755 --- a/extractHintergrund.py +++ b/extractHintergrund.py @@ -44,6 +44,7 @@ anchor = Struct( Const(b"\xff"*4), ) * "System anchor block" +assert pagesize//blockref.sizeof() == 128 blockTable = Array(pagesize//blockref.sizeof(), blockref) # XXX: skip const @@ -212,6 +213,10 @@ if __name__ == '__main__': with open (f'{taskid:04d}_{dsid:04d}.ds', 'wb') as outfd: os.ftruncate (outfd.fileno(), 0) + # the first page of a dataspace is used by the OS + # and not stored to the Hintergrund + outfd.seek (pagesize) + # get the first three pages for ref in d.blocks: copyblock (ref.value, fd, outfd) @@ -219,7 +224,7 @@ if __name__ == '__main__': # indirect block refs (level 4a) assert len (d.blockTables) == 2 # first four entries of first table are empty and must not be written! - copyBlockTable (d.blockTables[0].value, fd, outfd, 3) + copyBlockTable (d.blockTables[0].value, fd, outfd, 4) copyBlockTable (d.blockTables[1].value, fd, outfd) # segment tables (level 4b) |