#define VT_BOTTOM 23
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0200)) /* also data base */
+#define PROGLOAD ((char *)(0x0200))
#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA */
#define BOOT_TTY 3 /* Set this to default device for stdio, stderr */
#define VT_BOTTOM 23
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((uint8_t *)(0x8000)) /* also data base */
-#define PROGTOP ((uint8_t *)(0xff00)) /* Top of program */
+#define PROGBASE ((uint8_t *)(0x0000)) /* also data base */
+#define PROGLOAD ((uint8_t *)(0x0000)) /* also data base */
+#define PROGTOP ((uint8_t *)(0x7C00)) /* Top of program */
#define BOOT_TTY (512 + 1) /* Set this to default device for stdio, stderr */
/* In this case, the default is the first TTY device */
#define CONFIG_BANKS 1
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* also data base */
+#define PROGLOAD ((char *)(0x0100))
#define PROGTOP ((char *)(0x7D00)) /* Top of program, base of U_DATA */
#define PROC_SIZE 32 /* Memory needed per process */
#define VT_BOTTOM 23
#define TICKSPERSEC 50 /* Ticks per second (actually should be dynamic FIXME) */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* also data base */
+#define PROGLOAD ((char *)(0x0100))
#define PROGTOP ((char *)(0x7D00)) /* Top of program (uarea stash) */
#define BOOT_TTY (512 + 1) /* Set this to default device for stdio, stderr */
#define VT_BOTTOM 23
#define TICKSPERSEC 50 /* Ticks per second (actually should be dynamic FIXME) */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* also data base */
+#define PROGLOAD ((char *)(0x0100))
#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA */
#define BOOT_TTY (512 + 1) /* Set this to default device for stdio, stderr */
#endif
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* also data base */
+#define PROGLOAD ((char *)(0x0100))
#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA */
//#define PROC_SIZE 64 /* Memory needed per process (for now) */
#define VT_BOTTOM 31
#define TICKSPERSEC 50 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* memory base of program */
+#define PROGLOAD ((char *)(0x0100)) /* load base of program */
#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA */
#define PROC_SIZE 64 /* Memory needed per process */
/* FIXME: the OVL timer isn't quite 100/sec and we have an accurate 1Hz
timer available, so needs some tweaking */
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* also data base */
+#define PROGLOAD ((char *)(0x0100))
#define PROGTOP ((char *)(0x4000)) /* Top of program for debug */
#define SWAP_SIZE 0x40 /* 32K in blocks (with uarea means 31K max app size) */
#define CONFIG_BANKS 4 /* For now lets use 16K banking */
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000))
+#define PROGLOAD ((char *)(0x0100)) /* also data base */
#define PROGTOP ((char *)(0xF900)) /* Top of program, base of U_DATA */
#define BOOT_TTY (512 + 1)/* Set this to default device for stdio, stderr */
#define VT_BOTTOM 24
#define TICKSPERSEC 60 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000)) /* Base of user */
+#define PROGLOAD ((char *)(0x0100)) /* Load and run here
#define PROGTOP ((char *)(0xF900)) /* Top of program, base of U_DATA */
#define PROC_SIZE 64 /* Memory needed per process */
#undef CONFIG_CPM_EMU
#define TICKSPERSEC 100 /* Ticks per second */
-#define PROGBASE ((char *)(0x0100)) /* also data base */
+#define PROGBASE ((char *)(0x0000))
+#define PROGLOAD ((char *)(0x0100)) /* also data base */
#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA copy */
-#define BOOT_TTY 9 /* Set this to default device for stdio, stderr */
+#define BOOT_TTY 513 /* Set this to default device for stdio, stderr */
/* In this case, the default is the first TTY device */
/* We need a tidier way to do this from the loader */
#define CONFIG_BANKS 1
#define TICKSPERSEC 100 /* Ticks per second */
+#define PROGLOAD ((char *)(0x0000)) /* also data base */
#define PROGBASE ((char *)(0x0100)) /* also data base */
#define PROGTOP ((char *)(0xED00)) /* Top of program, base of U_DATA copy */
#define PROC_SIZE 60 /* Memory needed per process */
void create_init(void)
{
uint8_t *j;
- /* userspace: 0x100+ 0 1 2 3 4 5 6 7 8 9 A B C */
+ /* userspace: PROGLOAD +
+ 0 1 2 3 4 5 6 7 8 9 A B C */
const char arg[] =
{ '/', 'i', 'n', 'i', 't', 0, 0, 1, 1, 0, 0, 0, 0 };
*j = NO_FILE;
}
/* Poke the execve arguments into user data space so _execve() can read them back */
- uput(arg, PROGBASE, sizeof(arg));
+ uput(arg, PROGLOAD, sizeof(arg));
+ /* Poke in arv[0] - FIXME: Endianisms... */
+ uputw((uint16_t)PROGLOAD + 1, PROGLOAD + 7);
/* Set up things to look like the process is calling _execve() */
- udata.u_argn = (uint16_t) PROGBASE;
- /* FIXME - should be relative to PROGBASE... */
- udata.u_argn1 = 0x107; /* Arguments (just "/init") */
- udata.u_argn2 = 0x10b; /* Environment (none) */
+ udata.u_argn = (uint16_t) PROGLOAD;
+ udata.u_argn1 = (uint16_t)PROGLOAD + 0x7; /* Arguments (just "/init") */
+ udata.u_argn2 = (uint16_t)PROGLOAD + 0xb; /* Environment (none) */
}
void fuzix_main(void)
if (ino->c_node.i_mode & SET_GID)
udata.u_egid = ino->c_node.i_gid;
+ /* FIXME: In the execve case we may on some platforms have space
+ below PROGLOAD to clear... */
+
/* We are definitely going to succeed with the exec,
* so we can start writing over the old program
*/
- uput(buf, PROGBASE, 512); /* Move 1st Block to user bank */
+ uput(buf, PROGLOAD, 512); /* Move 1st Block to user bank */
brelse(buf);
- c = ugetc(PROGBASE);
+ c = ugetc(PROGLOAD);
if (c != 0xC3)
kprintf("Botched uput\n");
* same buffer to avoid cycling our small cache on this. Indirect blocks
* will still be cached. - Hat tip to Steve Hosgood's OMU for that trick
*/
- progptr = PROGBASE + 512; // we copied the first block already
+ progptr = PROGLOAD + 512; // we copied the first block already
/* Compute this once otherwise each loop we must recalculate this
as the compiler isn't entitled to assume the loop didn't change it */
doexec(emu_base);
else
#endif
- doexec(PROGBASE);
+ doexec(PROGLOAD);
// tidy up in various failure modes:
nogood3: