Commit Graph

2624 Commits

Author SHA1 Message Date
Travis Geiselbrecht
08b3238952 [arch][x86] clean up of mmu code
-Large cleanup of both the 32 and 64bit mmu code. Still the same general
flow but tighten up usage of mixing physical addresses with virtual
addresses.
-Remove the PAE code path from 32bit mmu, which was unused.
2022-10-23 20:37:33 -07:00
Travis Geiselbrecht
611bd1cba0 [bus][pci] ask for 4MB alignment when mapping the ecam
This helps any architecture that might have a better chance with using
large pages.
2022-10-21 23:47:47 -07:00
Travis Geiselbrecht
3a6b43cb32 [arch][mmu][tests] slight tweaks 2022-10-21 01:35:28 -07:00
Travis Geiselbrecht
d5451cc8e6 [arch][tests] add a way to query some arch mmu features
Allow asking the arch layer if it supports NX pages or NS pages.
Have the arch mmu test code test accordingly.
Also tweak the tests to pass on arm32 mmu, which does not precisely
match the return semantics of the rest of the mmu routines on map/unmap.
2022-10-21 00:00:49 -07:00
Travis Geiselbrecht
f1dad5f4c8 [arch][mmu] remove arch_mmu_disable which is currently unused 2022-10-20 23:26:45 -07:00
Travis Geiselbrecht
0b5202362d [arch][mmu][test] change the arch mmu test file to c++
This lets us more easily use some C++ for test cleanup.
Updated the arch mmu flags to be explicitly unsigned to make C++
happier.
2022-10-20 23:24:33 -07:00
Travis Geiselbrecht
f6a2610aef [arch][mmu][test] update a few of the expects to asserts in these tests
In a few places where it's dangerous to proceed, raise to an assert so the
test stops.
2022-10-19 21:02:06 -07:00
Travis Geiselbrecht
d36f5ab8d8 [arch][x86] fix a bug in the unmap routine on 32bit mmu code
Was apparently already fixed on the 64bit side, but never rolled back.
2022-10-19 20:58:32 -07:00
Travis Geiselbrecht
318673348f [arch][x86][32] fix a bug in the exception report
Some of the 16 bit values the cpu pushes on the stack are aligned to
32bit offsets but actually only 16 bits were pushed. Make sure printf
masks off the top 16 bits when printing these fields out.
2022-10-19 20:22:10 -07:00
Travis Geiselbrecht
b7d7215030 [arch][x86][fpu] clean up the fpu init code to print info later 2022-10-19 20:17:05 -07:00
Travis Geiselbrecht
77d8622268 [arch][x86] clean up a bit of the cpuid detection
Save the model/family information in a new structure.
Move the printing portion of the detection to the arch_init runtime
so it gets a chance to print after the uart is initialized.
2022-10-19 20:03:49 -07:00
Travis Geiselbrecht
2ac68a56a8 [arch][x86] no need to "memory" clobber simple in instructions
They only read data into the eax register instead of memory.
2022-10-19 19:27:57 -07:00
Travis Geiselbrecht
96231b132f [bus][pci] make the pci bus dump on bootup use a little less horizontal space
Should fit better on an 80 column display
2022-10-19 00:24:10 -07:00
Travis Geiselbrecht
208bae5feb [scripts][do-qemux86] use the older 'pc' machine model when selecting x86-32
This gets a bit more coverage of hardware. In general if using 32bit LK
it's for running on older hardware anyway.
2022-10-18 23:59:15 -07:00
Travis Geiselbrecht
3a6c4aed8f [bus][pci] do not automatically initialize the bus manager in pci_init_legacy
This lets the caller do any last minute resource set up before starting
the bus manager. Is consistent with the way pci_init_ecam() works.
2022-10-18 23:58:18 -07:00
Travis Geiselbrecht
5f9e6fdefc [arch][x86][cpuid] clamp number of cpuid entries to read at boot
Make sure we only read up to the max amount of cpuid values we have
preallocated in our static array.
2022-10-18 23:56:52 -07:00
Travis Geiselbrecht
e02401e4bf [arch][x86] fix up some in instruction macros
Turns out all of the in and rep ins/outs instruction macros have been wrong
since they were first added.

-Make sure they clobber memory
-Make sure edi/esi/ecx registers are marked as both read and written by
the instruction.

The latter was causing a codegen problem in the ide driver where the
pointer was pushed forward by a rep ins but the compiler didn't know the
register was modified.
2022-10-18 23:07:32 -07:00
Pedro Falcato
165f826ca3 [platform] [riscv-virt] Fix PLIC_PRIORITY macro
Old PLIC_PRIORITY macro had an off-by-one bug, causing you to set the
priority for the wrong IRQ.
2022-09-28 19:36:13 -07:00
Milis Linux
2550f205b8 [documentation] add a getting started guide 2022-09-26 10:08:08 -07:00
Michael Bishop
95ac371146 [lib][gfx] fix undefined flush pointer
all places that call flush, check if its null before calling it
but its never actually written to, so it can sometimes point to garbage and just fault
2022-09-25 18:16:52 -07:00
Michael Bishop
368b5f69b8 [lib][libc] add missing BE64SWAP 2022-09-25 18:16:06 -07:00
Michael Bishop
f4b2fa9a6b [dev][power][psci] refactor out of the qemu-virt-arm module 2022-09-25 18:14:50 -07:00
Travis Geiselbrecht
baca46e133 [lib][libc] fix an incorrect include path in a libc file 2022-09-25 18:03:59 -07:00
mni
034a8d0ede [libc] add atof() function 2022-09-06 10:26:41 -07:00
Travis Geiselbrecht
213cc90857 [gitignore] add clangd and vscode dirs to the ignore list 2022-08-18 19:14:22 -07:00
Travis Geiselbrecht
00d653306d [tools][bin2h] mark as python3 compatible 2022-08-18 19:11:46 -07:00
Travis Geiselbrecht
c44c6ed86e Merge from luka177:f4-update
Update the stm32f4xx ST peripheral libraries.
2022-08-14 19:07:35 -07:00
Travis Geiselbrecht
55a6a38469 [target][qemu-m4] tweak a line after stm32f4xx library changed a definition. 2022-08-14 19:06:23 -07:00
Travis Geiselbrecht
f2cf99bf73 [platform][stm32f4xx] append the necessary #define to GLOBAL_COMPILEFLAGS
GLOBAL_CFLAGS will only work for .c files, which breaks on the first
inclusion of the headers by a .cpp file. *_COMPILEFLAGS is for all
language types (C, asm, C++)
2022-08-14 19:05:20 -07:00
Travis Geiselbrecht
2985728864 [stm32f4xx][stdperiph driver] remove +x from file modes in imported files 2022-08-14 19:00:16 -07:00
Travis Geiselbrecht
627e0a5cc0 [stm32f4xx][stdperiph driver] fix a typo in a wait loop 2022-08-14 18:59:50 -07:00
Milis Linux
c4676e9445 [tcp] remove extra printf 2022-08-14 18:50:32 -07:00
Wencheng Yang
853bce759d [dev][bus][pci] fixed type1_read_byte API bug
It should invoke type1_read_byte() rather than type1_read_half.
2022-08-11 23:33:15 -07:00
Travis Geiselbrecht
62e2e7dba0 [platform][pc] move the multiboot header into generic space
Share the header with arch/x86 code
Clean up the use of the boot flags
Add code to print the framebuffer information, if present
2022-08-07 23:04:23 -07:00
Travis Geiselbrecht
8643334914 [platform][pc] update the multiboot memory detection code
Parse up to 16 pmm arenas from the multiboot memory data structure. Roll
the 32bit code to properly trim at 1GB as before, but using new logic.
Remove conditional checks on WITH_KERNEL_VM in x86 code, which only
really compiles with the mmu and the vm on.
2022-08-07 16:28:03 -07:00
Travis Geiselbrecht
497c52115b [platform][rosco-m68k] microoptimize the duart irq 2022-08-06 17:55:35 -07:00
Travis Geiselbrecht
b8de922781 [platform][rosco-m68k] delete some unused #defines 2022-08-06 17:41:12 -07:00
Travis Geiselbrecht
c3ea652c1f [platform][qemu-virt-m68k] fix timer interrupts
The IRQ calculation for the virtio range was off by 8, which caused the
virtio code to override the interrupt registration for the RTC, which
caused it to stop firing. Clean up the #defines that define irq mappings
to fix this issue.
2022-08-06 17:28:12 -07:00
Travis Geiselbrecht
fb373eb4de [arch][x86] drop march to x86-64
-march=x86-64-v2 is not supported on old compilers.

Can fix in the future, but for the moment may as well just drop -v2
since it's not really being used.
2022-07-24 20:03:46 -07:00
Travis Geiselbrecht
7505c3087a [arch][x86][fpu] spiff up the fpu code to detect things more cleanly
Doesn't really change the functionality of the code except it'll try to
work with less fpu features present.
2022-07-24 19:56:24 -07:00
Travis Geiselbrecht
c429ffcc7a [arch][x86] add more comprehensive feature bit routine
Cache copies of the first few cpuid leaves from each bank at bootup if
present. Add a fast routine to test feature bits out of this array.
2022-07-24 16:59:45 -07:00
luka177
52ca5d32c9 [External-platform-stm32f4xx]: stm32f4xx.h remove redefenitions 2022-07-24 09:13:02 +03:00
luka177
f2459fe0ab Fix line ending 2022-07-24 08:52:42 +03:00
Travis Geiselbrecht
3dff26ae7b [make] add BUILDDIR_SUFFIX build variable
This allows you to tag your build dirs with an optional string.

Update scripts/buildall to also allow building all release (DEBUG=0)
builds. Add a few other convenience switches.
2022-07-23 15:57:53 -07:00
Peter Collingbourne
576a7a7c82 [arch][arm64] determine the correct TCR_EL1.IPS at runtime
Change the early startup code to set TCR_EL1.IPS to
ID_AA64MMFR0_EL1.PARange if it has a defined value (the currently
defined values have the same meanings), but use 48-bit PAs if 52-bit
PAs are supported because 52-bit PAs have a different translation
table format that we don't support. Stash the computed TCR_EL1 in a
variable and use it in the context switch code.
2022-07-22 23:54:03 -07:00
Travis Geiselbrecht
cd96c43006 [make] define and undefine some make variables
Based on building with --warn-undefined-variables, find a few places in
the build system where undefined variables were used incorrectly, or
never set due to unused code.
2022-07-22 23:45:42 -07:00
Travis Geiselbrecht
8372f46055 [arch][riscv64] fix build with older toolchains (gcc 7.5.0)
When building fpu variant, use -march=rv64imafdc instead of rc64gc
since some older compilers and/or mainline do not understand the
equivalence when selecting libgcc.

This is only an issue on rv64 due to the need to pick out the medany
variant of libgcc.
2022-07-22 23:08:44 -07:00
luka177
6abb5b3db7 [STM32F4xx_StdPeriph_Driver] Define assert_param 2022-07-21 19:22:19 +03:00
luka177
17a2af5ceb [platform-stm32f4xx] Updata chip defenition 2022-07-21 19:19:31 +03:00
luka177
126abea100 Update to latest STM32F4xx_StdPeriph_Driver 2022-07-21 19:13:37 +03:00