home *** CD-ROM | disk | FTP | other *** search
- wosemuppc.notes
-
- o 16.1011
- - Fixed GetCPU(), it returned an invalid value
-
- o 16.1010
- - Added native GetSysTimePPC
- - some cleanup of these notes.. :)
-
- o 16.1009
- - cleanup
- - added to the module.rom
- (Ralph)
-
- o 16.1008
- - Noticed that cli command "stack" doesn't affect PPC stack. doh.
- Now RunPPC() allocates a bigger stack if current one is smaller
- than 2*68k stack. This fixed rest of h2 probs.
-
- o 16.1007
- - Just some debug info to see if AMP134 calls Run68k with positive
- library offset...
-
- o 16.1006
- - Big changes in mem system. MEMF_CHIP allocs are allocated from
- task's tc_MemEntry, other allocs from task's pool.
-
- - FreeAllMem() not called in ppctask cleanup, but the mem will get
- freed when 68k task quits (because of the above).
-
- o 16.1005
- - Run68K works now if called with no library base in A6.....
-
- o 16.1004
- - Heretic2 works! It calls FreeVecPPC for mem allocated with
- exec AllocVec.. added a workaround
-
- - FreeVecPPC now also works for mem allocated from other tasks.
-
- o 16.1003
- - No longer runs in Forbid!
-
- - RunPPC does a cache flush only first time it is run per process.
-
- - FreeVecPPC bug fixed..
-
- o 16.1002
- - CreatePPCTask and AllocXMsg were broken, work now
-
- - Implemented RawDoFmtPPC
-
- - Implemented DeleteTaskPPC(NULL). Not possible to allow deleting of
- other tasks, because our wos tasks are really processes.. ugh.
-
- - TaskIDs are now assigned properly. IDs below 1000 match the CLI
- number, if available.
-
- - GetInfo now returns correct bus clock.
-
- - Run68K works with stack parameters now.
-
- o 16.1001
- - Fixed recursive RunPPC problem. TableTennis works now.
-
- - Always run in Forbid(), even for gcc-compiled programs. Fixes
- problems with shared wos libraries that trash r2 even if the program
- doesn't.
-
- - All wosemu functions now preserve CTR.. Some WOS programs seem to
- assume this, although CTR is specified as volatile in PowerOpen ABI!
-
- - Unsupported functions now pop up a requester.
-
- - CreateTaskPPC and CreatePPCTask implemented.
-
-
- o 16.1000
- - first alpha
-
-
- ----
- Some general notes about emu and warpos in general.. During the programming
- i found some annoyances in wos design, which i try to list here. This is
- not ment to be "wos bashing", just some things which warpos developers will
- face too if they ever plan to have 68k emulation and/or native OS. Also
- this could be interesting reading for all wos developers.
-
- - Memory system is weird.. If you have a shell and launch ppcprog1 which
- allocates mem and doesn't release it, then run ppcprog2 which calls
- FreeAllMem() also the memory allocated by ppcprog1 is freed. :) This
- is duplicated in the emu.
-
- - First wos program launched in a shell allocates signals and never
- releases them. This confuses for example WShell. Not emulated.
-
- - All internal structures are public! User shouldn't need to know about
- the internal new fields in msgport and semaphore structures... Luckily,
- most software seem to ignore them, so i just used the exec equivalents
- without the extra fields.
-
- - Above is much worse with TaskPPC.. TaskPPC is an exec task with some
- new fields appended. Sounds nice, but how can i call dos.library with a
- task? Wosemu allocates TaskPPC for each warpos process, and tries to
- keep that in sync with the real process struct.. Would be a lot easier
- if we could just define struct TaskPPC == struct Process. I tried that
- actually, it was quite ok but showtasks and similar programs show funny
- values.. :) and taskid's are random. So it's not a very good solution,
- but might be in the future when we have native dos.library..
-
- - According to wos history.txt, it is possible to signal a ppc task by
- using exec/Signal().. What's the point in this? Now, if wos tasks were
- processes, this would work automatically, but with the current system
- it requires an exec patch. Real wos does this patch, wosemu doesn't. No
- software seems to use it and imho it's dirty.
-
- - WOS is documented as using PowerOpen ABI, yet even some wos example
- programs (WarpRace) violates this by expecting library functions to
- preserve CTR register.. I had to add CTR store/restore to each library
- function to make it work properly. Annoyance and unnecessary slowdown.
-
- - WarpOS allows user programs to enter supervisor mode and access MMU
- tables. This is a big no-no in any modern os, and is not (can't be
- and shouldn't be and won't be) emulated. Most software doesn't use
- these anyway.
-
- - Run68k and RunPPC have way too many methods to pass arguments.. Float
- arguments are almost never used, yet they take a lot of time to
- initialize. Also stack arguments are useless, user can pass a pointer
- to stack in some register if that's needed.. Currently, wosemu supports
- all argument types in RunPPC, and only integer/stack in Run68k. I doubt
- that ppc code calls 68k fpu code very often..
-
- - Run68k autodoc doesn't specify if you are supposed to initialize A6
- or not, when calling OS functions. And of course some programs don't
- initialize it. So I just copy the base to A6 before calling..
-
- - WOS gcc startup code relocates the code, then calls RunPPC. This is ok
- in real wos because RunPPC always flushes all caches, but in wosemu
- i had to add extra (unnecessary) cache flush there. That's why RunPPC
- results in WarpRace are not so brilliant as you might expect.
-
- - WOS has some PPC library functions that are documented to preserve all
- registers.. Weird stuff.
-
- - WOS has alignment emulation for FPU. PPC can only access longword
- aligned memory when loading/storing float registers. If unaligned memory
- is addressed, an "illegal alignment exception" is thrown. In warpos, the
- exception handler then does the memory access, and returns back to the
- program.. This gives the programmer the impression that everything is
- working fine, which really isn't the case.. Emulated access is probably
- over 100 times slower than regular mem access, so by simply fixing the
- alignment the program could be much faster. This is similar to using
- the 64bit math instructions in 060, they are emulated too and clever
- programmers avoid them.
- Morphos currently doesn't have alignment emulation, so any program that
- uses this will fail. Even in the future when alignment emulation
- probably is implemented, it will still output a full debug dump so the
- programmer can immediately notice that something is wrong.
- So far, only program affected this is the "DeathTrial" demo by Mankind.
- However, they have already created a fixed version.
-
- -Zui (zu@iki.fi)
-
-
-
-
-
-
-
-