execve: per CPU magic, also allow for different program base
authorAlan Cox <alan@etchedpixels.co.uk>
Sun, 23 Nov 2014 22:36:10 +0000 (22:36 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sun, 23 Nov 2014 22:36:10 +0000 (22:36 +0000)
commitfd13e7f08cb7755357b5d27f45d5bad905568f39
tree3b40602c44682e2d7e10ed7ca5147dfddb1dbad3
parentefd8aa91eae7801dfdf63a3b40c9d05b6064abb6
execve: per CPU magic, also allow for different program base

Use different magic numbers for different CPU types. Note that we need to
pass some kind of base info and check it in future (or support relocatable
binaries ?)

As noted by Atsidaev our handling of some of this was rather confused. We
now pass the size (top - PROGBASE) to the allocator. This sort of assumes for
6502 we'll set 0x0200 (or higher) entry and 0x0000 base and something similar
for 6809.

zx128 will still need a custom banking module eventually. Once someone
beats SDCC into banking the kernel code that can mostly live in 2 (or 3)
16K banks in an interface 2 cartridge with banking support then it can
use 0x8000-0xBFFF and lazy memcpy it from another page (or even exchange
two pages) on a taskswitch between two different 32K apps.

See: http://www.fruitcake.plus.com/Sinclair/Interface2/Cartridges/Interface2_RC_Custom.htm#SoftwarePaging
Kernel/cpu-6502/cpu.h
Kernel/cpu-6809/cpu.h
Kernel/cpu-z80/cpu.h
Kernel/include/kernel.h
Kernel/syscall_exec.c