From e6a3feccab8c555013960e5b730582f24ab55477 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sun, 10 Sep 2017 17:36:08 +0200 Subject: partial implementation for ctc drivers and memory management --- sw/z80/kernel/include/drivers/ctc.h | 6 ++++++ sw/z80/kernel/include/fs/fs.h | 2 +- sw/z80/kernel/include/memory.h | 9 ++++++--- sw/z80/kernel/include/types.h | 7 +------ 4 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 sw/z80/kernel/include/drivers/ctc.h (limited to 'sw/z80/kernel/include') diff --git a/sw/z80/kernel/include/drivers/ctc.h b/sw/z80/kernel/include/drivers/ctc.h new file mode 100644 index 0000000..488e02b --- /dev/null +++ b/sw/z80/kernel/include/drivers/ctc.h @@ -0,0 +1,6 @@ +#ifndef __CTC_H__ +#define __CTC_H__ + +void ctc_control() + +#endif /* __CTC_H__ */ \ No newline at end of file diff --git a/sw/z80/kernel/include/fs/fs.h b/sw/z80/kernel/include/fs/fs.h index 2a0e9d4..81c86b7 100644 --- a/sw/z80/kernel/include/fs/fs.h +++ b/sw/z80/kernel/include/fs/fs.h @@ -53,7 +53,7 @@ struct fs_inode time_t ctime; // creation time /* data storage informations */ - uint24_t size; + uint16_t size; uint16_t blocks[FS_BLOCKS_N]; } diff --git a/sw/z80/kernel/include/memory.h b/sw/z80/kernel/include/memory.h index 60fc98a..67c4b88 100644 --- a/sw/z80/kernel/include/memory.h +++ b/sw/z80/kernel/include/memory.h @@ -6,6 +6,7 @@ /* maximum number of pages on the system */ #define PAGES_MAX_COUNT 32 +#define PAGE_SIZE 1000 /* in our system there are only 16 pages since only 64KB can be addressed * to optimize the memory management in ROM and RAM only pages from this set @@ -31,17 +32,19 @@ #define ADDR_PAGE_14 0xE000 #define ADDR_PAGE_15 0xF000 +#define ADDR_PAGE_FIRST ADDR_PAGE_8 +#define ADDR_PAGE_LAST ADDR_PAGE_15 + struct page { pid_t pid; // process owner of the page (0 if free) uint16_t addr; // physical address }; -extern struct page pages_table[PAGES_MAX_COUNT]; - int mmu_write_table(void); +int page_new(void); int page_map(int page, int pid, uint16_t addr); int page_unmap(int page); -#endif // __MEMORY_H__ \ No newline at end of file +#endif // __MEMORY_H__ diff --git a/sw/z80/kernel/include/types.h b/sw/z80/kernel/include/types.h index b822144..7f38abb 100644 --- a/sw/z80/kernel/include/types.h +++ b/sw/z80/kernel/include/types.h @@ -10,15 +10,10 @@ #define int8_t char #define uint8_t unsigned char #define int16_t int -#define uint16_t unsigned long int +#define uint16_t unsigned int #define size_t uint16_t #define pid_t uint8_t - #define ino_t uint16_t -typedef struct { - uint data : 24; -} uint24_t; - #endif -- cgit v1.2.1