osmemory_read_size

Tom Hughes tom at compton.nu
Sun Sep 24 15:09:00 BST 2000


In message <Pine.LNX.4.21.0009241402320.20640-100000 at willow.armlinux.org>
          Chris Rutter <chris at willow.armlinux.org> wrote:

> This doesn't seem to work; I would try and look at the AOF, but the
> library members are named in some way which wasn't obvious within thirty
> seconds of glancing so I couldn't extract it.  Anyway, this program:
>
>     int tbsz, pgsz;
>     osmemory_read_size(6, &tbsz, &pgsz);
>
> produces `bad reason code', and this one:
>
>     int tbsz, pgsz;
>     osmemory_read_size(0, &tbsz, &pgsz);
>
> produces `Parameters not recognised'.

Probably - the valid types in the first parameter are:

  0x10 - DRAM
  0x20 - VRAM
  0x30 - ROM
  0x40 - I/O (including I/O, VIDC and EASI space)

> Crudely scanning through OSLib.o in Zap, I seem to have found the stub:
>
>     stmdb   r13!, {r1, r2}
>     orr     r0, r0, #8
>     swi     OS_Memory
>     ldr     r12, [r13, #0]
>     teq     r12, #0
>     strne   r1, [r12, #0]
>     ...
>
> Well, that #8 looks overwhelmingly wrong to me.

Why? That is the base reason code for the OS_Memory call that reads
the amount of a specified sort of memory that is available. It then
ors in R0 which is the supplied flags (in this case the type code to
indicate what type of memory you're interested in).

Were you actually after reason code 6 of OS_Memory? Only OSLib has
that as osmemory_read_arrangement_table_size().

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
...ERROR: COMPUTER POSSESSED. LOAD EXOR.SYS? (Y/N)




More information about the oslib-user mailing list