mirror of
https://github.com/plctlab/riscv-operating-system-mooc.git
synced 2025-12-26 17:19:04 +00:00
initial versioin
This commit is contained in:
29
code/os/04-multitask/platform.h
Normal file
29
code/os/04-multitask/platform.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef __PLATFORM_H__
|
||||
#define __PLATFORM_H__
|
||||
|
||||
/*
|
||||
* QEMU RISC-V Virt machine with 16550a UART and VirtIO MMIO
|
||||
*/
|
||||
|
||||
/*
|
||||
* maximum number of CPUs
|
||||
* see https://github.com/qemu/qemu/blob/master/include/hw/riscv/virt.h
|
||||
* #define VIRT_CPUS_MAX 8
|
||||
*/
|
||||
#define MAXNUM_CPU 8
|
||||
|
||||
/*
|
||||
* MemoryMap
|
||||
* see https://github.com/qemu/qemu/blob/master/hw/riscv/virt.c, virt_memmap[]
|
||||
* 0x00001000 -- boot ROM, provided by qemu
|
||||
* 0x02000000 -- CLINT
|
||||
* 0x0C000000 -- PLIC
|
||||
* 0x10000000 -- UART0
|
||||
* 0x10001000 -- virtio disk
|
||||
* 0x80000000 -- boot ROM jumps here in machine mode, where we load our kernel
|
||||
*/
|
||||
|
||||
/* This machine puts UART registers here in physical memory. */
|
||||
#define UART0 0x10000000L
|
||||
|
||||
#endif /* __PLATFORM_H__ */
|
||||
Reference in New Issue
Block a user