From 5205dd55913d296b359b019645cf555ef3eea70f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 17 May 2015 23:35:00 +0100 Subject: [PATCH] 6809test: get it building again just for some size measurements --- Kernel/platform-6809test/Makefile | 2 +- Kernel/platform-6809test/config.h | 15 ++++++++------- Kernel/platform-6809test/devtty.c | 5 +++++ Kernel/platform-6809test/kernel.def | 12 ++++++++++++ Kernel/platform-6809test/libc.c | 11 +---------- Kernel/platform-6809test/main.c | 16 ---------------- Kernel/platform-6809test/p6809.s | 8 ++++++-- Kernel/platform-6809test/tricks.s | 2 +- 8 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Kernel/platform-6809test/Makefile b/Kernel/platform-6809test/Makefile index f7144644..0e6a34e7 100644 --- a/Kernel/platform-6809test/Makefile +++ b/Kernel/platform-6809test/Makefile @@ -29,5 +29,5 @@ image: tricks.o main.o ../timer.o ../kdata.o devrd.o devices.o \ ../devio.o ../filesys.o ../process.o ../inode.o ../syscall_fs.o \ ../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o ../bank16k.o \ - ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec.o \ + ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \ ../usermem_std-6809.o devlpr.o devtty.o libc.o diff --git a/Kernel/platform-6809test/config.h b/Kernel/platform-6809test/config.h index c14154ff..f8aeaba1 100644 --- a/Kernel/platform-6809test/config.h +++ b/Kernel/platform-6809test/config.h @@ -28,8 +28,6 @@ /* Video terminal, not a serial tty */ #define CONFIG_VT -/* We want the 8x8 font */ -#define CONFIG_FONT_8X8 /* Vt definitions */ #define VT_WIDTH 64 #define VT_HEIGHT 24 @@ -37,8 +35,9 @@ #define VT_BOTTOM 23 #define TICKSPERSEC 100 /* Ticks per second */ -#define PROGBASE ((char *)(0x0100)) /* also data base */ -#define PROGTOP ((char *)(0xF000)) /* Top of program, base of U_DATA */ +#define PROGBASE 0x0100 /* also data base */ +#define PROGLOAD 0x0800 /* also data base */ +#define PROGTOP 0x7000 /* Top of program, base of U_DATA */ #define BOOT_TTY (512 + 1) /* Set this to default device for stdio, stderr */ /* In this case, the default is the first TTY device */ @@ -48,9 +47,11 @@ #define CMDLINE NULL /* Location of root dev name */ /* Device parameters */ -#define NUM_DEV_TTY 3 +#define NUM_DEV_TTY 2 #define NDEVS 1 /* Devices 0..NDEVS-1 are capable of being mounted */ /* (add new mountable devices to beginning area.) */ #define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */ -#define NBUFS 10 /* Number of block buffers */ -#define NMOUNTS 1 /* Number of mounts at a time - nothing mountable! */ +#define NBUFS 7 /* Number of block buffers */ +#define NMOUNTS 2 /* Number of mounts at a time - nothing mountable! */ + +#define swap_map(x) ((uint8_t *)(x)) diff --git a/Kernel/platform-6809test/devtty.c b/Kernel/platform-6809test/devtty.c index bfaca91f..bd844e5b 100644 --- a/Kernel/platform-6809test/devtty.c +++ b/Kernel/platform-6809test/devtty.c @@ -56,6 +56,11 @@ void tty_putc(uint8_t minor, unsigned char c) *uarta = c; } +void tty_sleeping(uint8_t minor) +{ + used(minor); +} + void tty_setup(uint8_t minor) { minor; diff --git a/Kernel/platform-6809test/kernel.def b/Kernel/platform-6809test/kernel.def index 39b9a0ed..20c80369 100644 --- a/Kernel/platform-6809test/kernel.def +++ b/Kernel/platform-6809test/kernel.def @@ -3,3 +3,15 @@ U_DATA equ 0xF000 ; (this is struct u_data from kernel.h) U_DATA__TOTALSIZE equ 0x300 ; 256+256+256 bytes. +SAM_USER macro + endm + +SAM_KERNEL macro + endm + +SAM_SAVE macro + endm + +SAM_RESTORE macro + endm + diff --git a/Kernel/platform-6809test/libc.c b/Kernel/platform-6809test/libc.c index 8b3940ba..311e4117 100644 --- a/Kernel/platform-6809test/libc.c +++ b/Kernel/platform-6809test/libc.c @@ -1,6 +1,6 @@ #include "cpu.h" -void *memcpy(void *d, void *s, size_t sz) +void *memcpy(void *d, const void *s, size_t sz) { unsigned char *dp, *sp; while(sz--) @@ -23,12 +23,3 @@ size_t strlen(const char *p) return e-p-1; } -/* Until we pull out the bits of libgcc that are useful instead */ -void abort(void) -{ -} - -void *malloc(size_t size) -{ - return 0; -} \ No newline at end of file diff --git a/Kernel/platform-6809test/main.c b/Kernel/platform-6809test/main.c index 75ccedbc..185152db 100644 --- a/Kernel/platform-6809test/main.c +++ b/Kernel/platform-6809test/main.c @@ -4,22 +4,6 @@ #include #include -/* The uarea is already synched to the stash which is written with the - process */ -uint8_t *swapout_prepare_uarea(ptptr p) -{ - p; - return NULL; -} - -/* The switchin code will move the uarea into the process itself, we just - need to fix up the u_page pointer */ -uint8_t *swapin_prepare_uarea(ptptr p) -{ - p; - return NULL; -} - void platform_idle(void) { } diff --git a/Kernel/platform-6809test/p6809.s b/Kernel/platform-6809test/p6809.s index 9f485a04..7022dd11 100644 --- a/Kernel/platform-6809test/p6809.s +++ b/Kernel/platform-6809test/p6809.s @@ -14,6 +14,7 @@ .globl map_process_always .globl map_save .globl map_restore + .globl _kernel_flag ; exported debugging tools .globl _trap_monitor @@ -34,7 +35,7 @@ ; ----------------------------------------------------------------------------- ; COMMON MEMORY BANK (0xF000 upwards) ; ----------------------------------------------------------------------------- - .area _COMMONMEM + .area .common trapmsg: .ascii "Trapdoor: SP=" .db 0 @@ -89,7 +90,7 @@ init_hardware: ;------------------------------------------------------------------------------ ; COMMON MEMORY PROCEDURES FOLLOW - .area _COMMONMEM + .area .common _program_vectors: ; @@ -221,3 +222,6 @@ outcharw: beq outcharw sta 0xffa1 puls b,pc + + .area .data +_kernel_flag: .db 1 diff --git a/Kernel/platform-6809test/tricks.s b/Kernel/platform-6809test/tricks.s index 3fb76a3f..1c85c08f 100644 --- a/Kernel/platform-6809test/tricks.s +++ b/Kernel/platform-6809test/tricks.s @@ -17,7 +17,7 @@ include "kernel.def" include "../kernel09.def" - .area _COMMONMEM + .area .common ; ramtop must be in common for single process swapping cases ; and its a constant for the others from before init forks so it'll be fine -- 2.34.1