[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
New support for memory IOS
From: |
Jose E. Marchesi |
Subject: |
New support for memory IOS |
Date: |
Sun, 02 Feb 2020 19:56:00 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hi people!
So I just committed support for IOS that are backed by memory buffers,
instead of files. These IO spaces are intended to be used in a similar
way buffers are used in text editors.
At the command level, a new dot-command .mem has been added. It is very
similar to the existing .file dot-command, and creates a new memory IOS
like this:
(poke) .file foo.o
The current file is now `foo.o'.
(poke) .mem foo
The current IOS is now `*foo*'.
(poke) .info ios
Id Mode Position Name
* #1 0x00000000#b *foo*
#0 rw 0x00000000#b foo.o
Note how:
- Asterisks are automatically added to the name of the memory IOS. This
is to distinguish memory IOS from file IOS. (Yeah this means we can't
edit files with names having a leading and trailing asterisks, but we
are gonna have to live with that.)
- The .info files command has been renamed to .info ios, for obvious
reasons. The column Filename is now called Name.
- The memory IOS has no mode. We may want to change that in the future,
so the user can set memory IOS in read-only mode to avoid overwriting
the information they contain...
At the Poke programming level, memory IOS can be created using the
`open' built-in, function. This time, it is up to the user to add the
asterisks, or a file will be opened instead:
defvar file = open ("foo");
defvar buffer = open ("*foo*");
The memory IOS are self-growing, i.e. they grow as needed to hold what
is written to them.
As for use cases for memory IOS, consider for example you want to mess
with a compressed ELF section: you would uncompress the section in a
memory IOS and then operate on the data there.
Salud!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- New support for memory IOS,
Jose E. Marchesi <=