OS_Write0 returns a pointer
[riscose.git] / TODO
blob07301c09f04d4b4e26dd1b4df2601545f999badf
1 Riscose -- To do list
2 ---------------------
4 Bloody hell, lots!
6 My first priority is to get command-line programs running properly before we
7 move onto emulating the Wimp and other graphical bits and pieces.  But first
8 we ought to fix bugs.  Anyhow, in rough order of priority, here's what needs
9 doing:
11 * SharedCLib file handling 
13 Currently, when a RISC OS program calls fopen(), some memory is put aside in
14 the RMA to hold a FILE* where the real Unix fopen() stores its filehandle. 
15 Then we can at least point RISC OS to an FILE object.  I think UnixLib
16 actually tries to read the data in this area, assuming it to be a RISC OS
17 FILE object, which it ain't.  So programs that call UnixLib stat() fail
18 after reading some weird results.  I'm not sure, firstly whether this is the
19 problem, or whether we ought to just emulate a RISC OS FILE struct in toto.
21 And if we're going down this route, I probably ought to make sure that it
22 works with OS_Args so we've got a proper mapping between RISC OS filehandles
23 and CLib FILE structs.  Oh, and I've not implemented any of OS_Args yet :-)
25 I'm also pretty sure there's a bug or two in fwrite() / fread() since the
26 unzip program gets funny results from them, and also seems to spew its
27 diagnostic messages more than once, along with some top-bit set characters. 
28 Hey ho.
30 * The rest of SharedCLib
32 There's still quite a few functions that aren't emulated, but the emulator
33 will helpfully grind to a halt and tell you if that happens.  Then you just
34 have to look up the number in clib_functions.h and write a trivial wrapper
35 around the appropriate native function in swih_sharedclibrary.c .
37 * Code cleanup!
39 There's quite a lot of really mucky casts that have to go on so as we can
40 (e.g.) hide native file handles in RISC OS memory and retrieve them later; I
41 think this is just par for the course given that we're constantly
42 translating between ARM + native address spaces, but I ought to write some
43 macros to make the code more readable.  Or is there a better way...?
45 Also, I ought to split off stolen code like the ARMulator and Gareth's
46 instruction disassembler into separate directories.
48 We often have new values for the four processor status registers, N, Z,
49 C, and V, yet only have arm_clear_X() and arm_set_X() to do one flag at
50 a time.  We need a routine implemented in armul, sleeve, and native,
51 that lets us set some of them in one go and returns their new values.
53     psr arm_set_psr(psr and, psr xor);
55 * The heap manager algorithm
57 Is just naff and will slow programs down that allocate and deallocate lots
58 of memory: when asked to allocate memory out of a heap, it just starts at
59 the beginning of the list of allocated blocks and steps over 'til it hits
60 he end or finds a suitable gap.
62 * Documentation
64 Create riscosehack man page.
66 * Build
68 See if GNU readline is mandatory.  If it doesn't add much, remove it.
69 Else get configure to check for it and either insist on its presence or
70 adapt accordingly.