[Freemint-list] Load MINT.CNF at odd address

Markus Fröschle mfro999 at gmail.com
Mon Mar 20 17:51:00 MSK 2017


On Mon, Mar 20, 2017 at 1:37 PM, Vincent Rivière <
vincent.riviere at freesbee.fr> wrote:

> On 20/03/2017 at 08:32, Markus Fröschle wrote:
> > To me, it appears parser() would _always_ load the config file to an
> > unaligned buffer:
>
> Great investigation!
> Are you going to provide a patch / pull request?
> (if so I will just quietly wait for that :-) )
>

Hmm, no, I don't think so. Not because I wouldn't want but rather because I
currently think the code is perfectly valid as it is.

The parser, to my understanding, uses the unaligned buffer (1 byte offset)
as kind of character pushback function (just like ungetc() for a
stdio-based parser). It goes through the in-memory copy of the config file
and copies each character it has read and understood to the next lower
position (so, after the initial scan, the buffer starts at an even address).

It might not be nice to disk-read to an unaligned buffer, but nevertheless
perfectly valid.

All OS disk I/O functions, no matter if they are BIOS, GEMDOS or XBIOS,
have void * parameters for the buffer address and no documented alignment
requirements, so all these functions should be able to deal with unaligned
buffers, IMHO.

Sure, we could fix (rather: mend) that in MiNT, but I'd assume we will run
into the same problem later on elsewhere. I guess we should rather have a
look into the EmuTOS IDE driver instead (I'd assume the ACSI driver
shouldn't have this problem as it reads byte-wise anyway).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.atariforge.org/pipermail/freemint-list/attachments/20170320/d804e75d/attachment.html 


More information about the Freemint-list mailing list