Commit Graph

2383 Commits

Author SHA1 Message Date
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
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
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
Travis Geiselbrecht
b0d8aeed18 [arch][riscv] add fpu context switch support
Currently only implemented for double precision floating point.

Caveat: currently unable to only compile some code with or without
float. The linker is extremely picky about mixing float and no-float
objects, so stick with all on or off for now.

It's not as much of a problem currently because the toolchain is not
using any riscv vector instructions to assist normal code, so it's
generally only emitting fpu instructions for floating point code.
2022-07-17 23:27:42 -07:00
Travis Geiselbrecht
6462cbf51c [arch][fpu] add ability to specify per file or module if code needs fpu
Have the arch define additional compiler flags to explicit support or
not support a floating point unit.

Add ability for modules to per file or for the whole module mark code
as needing floating point support.

Add default flags for arm64, riscv, and x86 toolchains.

Needed because gcc 12 is getting much more aggressive about using vector
instructions for non float code, so getting away with avoiding it was
no longer working.

Still not perfect: printf code is being compiled with float, so it's
possible to use floating point instructions inside core kernel or
interrupt handling code if a printf is used.

Possibly will have problems on architectures where mixing float and non
float code at the linker generates issues, but so far seems to be okay.
2022-07-17 16:32:24 -07:00
Peter Collingbourne
b7af2cdf26 [arch][arm64] replace the trampoline translation table with a trampoline VBAR
I noticed that LK failed to boot on systems that do not support 64KB
page sizes (e.g. Linux KVM guest on Apple M1) because the trampoline
translation table used a compile-time hardcoded 64KB page size.

Instead of trying to make the trampoline translation table code
look for a supported page size at runtime, I realized that it should
be possible to remove the trampoline translation table entirely by
replacing it with a VBAR that branches to the instruction following
the MMU enable. That's what this patch does.
2022-07-17 13:49:59 -07:00
Travis Geiselbrecht
a007f66728 [arch][arm64] update some comments in assembly 2022-07-17 13:21:31 -07:00
Aaron Odell
be0ba2ca14 [arch][arm64] cache maintainance on page tables during boot
Add cache clean + invalidate on the page tables that get modified during
startup before the MMU is enabled. Without this, if these memory regions
were present in cache before LK started, the CPU will see the stale
cached values as soon as the MMU is enabled. Invalidating these forces
the CPU to fetch the correct values from memory after the MMU is enabled.
2022-07-17 13:18:59 -07:00
Travis Geiselbrecht
6edff96534 [make] update ip address to try to copy to in the 'install' target 2022-06-05 15:58:06 -07:00
Travis Geiselbrecht
d80592ba7d [lib][acpi_lite] add some additional LTRACEFs
Added to try to track down an issue on a particular PC.
2022-06-05 15:57:45 -07:00
Travis Geiselbrecht
c580451e83 [arch][riscv] more interrupt cause debugging strings 2022-05-29 17:55:41 -07:00
Travis Geiselbrecht
095aca80f1 [arch][riscv][sbi] add the pmu extension, tweak boot messages, qemu-virt use reset calls 2022-05-29 14:48:04 -07:00
Travis Geiselbrecht
b3dd72ab1d [github][ci] switch current toolchain to 12.1 2022-05-22 16:41:57 -07:00
Travis Geiselbrecht
a8e460f847 [arch][riscv] add -misa-spec=2.2 to the compile switches
This works around an issue with newer compilers that default to an
earlier ISA spec that doesn't by default include the zicsr extension by
default.

If the compiler doesn't support the switch, then it's assumed that it
has the extension by default, as older gcc compilers did.
2022-05-22 15:14:34 -07:00
Travis Geiselbrecht
e798c47e89 [lib][debugcommands] add a workaround for gcc 12.1
GCC 12 seems to be much more aggressive about warnings about any
dereferences near 0. For this particular piece of code, which is
explicitly trying to force a fault by touching address 1, simply disable
the warning around the block of code.
2022-05-21 17:29:30 -07:00
Travis Geiselbrecht
d496ca1902 [platform][rosco-m68k] add proper support for the system data block
A block of data left behind by the firmware to tell the system important
things such as the size of memory.
2022-05-21 17:26:49 -07:00
Travis Geiselbrecht
4695035505 [arch][riscv] C++ header guard the core riscv header 2022-05-13 01:06:58 -07:00
Travis Geiselbrecht
469b0b73f6 [lib][elf] add C++ header guards 2022-05-13 01:04:05 -07:00
Travis Geiselbrecht
4a7c0ae925 [fs][fat] fix an incorrect assert 2022-05-13 01:03:15 -07:00
Travis Geiselbrecht
d525a5f7b5 [fs][fat][test] pass in the path to the test dir so files can be included correctly
Due to the way INCBIN works, the full path relative to the root of the
assembler instance must be used, so pass in the full path as a define.
2022-05-12 22:26:22 -07:00
Travis Geiselbrecht
def9bea065 [fs][fat] general fs structural improvements
Move more of the driver into a proper object oriented model.
Start to build the structure to track open file/dirs so as to
allow multiple open instances share the same underlying object.
2022-05-12 20:26:52 -07:00
Travis Geiselbrecht
b76ba5ec0e [scripts][do-qemuriscv] synchronize with options available from arm version
Most notably the ability to specify the disk image
2022-05-12 20:24:17 -07:00
Travis Geiselbrecht
74386913a0 [scripts][do-qemuarm] set script=no when using tun/tap 2022-05-12 20:08:21 -07:00
Travis Geiselbrecht
3ba03f7def [external][libm] add -Wno-maybe-uninitialized
Some older code triggers this warning on gcc 12.1.
2022-05-12 20:04:42 -07:00
Travis Geiselbrecht
89f8e62587 [fs][fat][test] add some more test code
Also create a large zero filled file and add it to the test fs, to try
to make sure there's at least one file that crosses a FAT sector.
2022-04-29 22:12:30 -07:00
Travis Geiselbrecht
144f608bce [fs][fat] add support for FAT12
The 12 bit fat parsing code is a little tricky.
2022-04-29 22:10:11 -07:00
Travis Geiselbrecht
40f516c15a [lib][unittest] tweak the command line to let you list and selectively run individual tests 2022-04-29 20:39:05 -07:00
Travis Geiselbrecht
9a39da5651 [app] tweak app start to only run apps with entry points defined
Also remove a few empty extraneous app structs that are not doing
anything currently.
2022-04-29 20:38:15 -07:00
Travis Geiselbrecht
914c9c2a2f [dev][virtio-blk] update to newer version of the device
Nothing fundamentally changed, just update to new feature bits and print
them at device detection time.
Try to negotiate the guest feature set as well, though nothing
fundamentally changes at this time.
2022-04-26 00:40:03 -07:00
Travis Geiselbrecht
b834181637 [dev][virtio-block] fix bug when not using paging
In the non VM path the existing routine wouldn't subtract from len, so
the function would (properly) return bytes transferred instead of zero.

The wrapping code was written to assume 0 and not bytes transferred,
which seemed like a workaround for broken code. Change the inner routine
to always return bytes transferred and adjust wrapper routines
accordingly.
2022-04-25 23:37:39 -07:00
Travis Geiselbrecht
1c9caf9f64 [fs][fat][test] start of unittests for fat file system
Requires a block device be present with a pre-formatted fs, but
should fail gracefully if its not present.
2022-04-25 23:17:55 -07:00
Travis Geiselbrecht
f6f43edc3c [fs][tests] break some fs tests into their own module
Include the test modules if the overal virtual/test module is included.
Also set a new global build system var along with a configuration
variable.
2022-04-25 23:17:55 -07:00
Travis Geiselbrecht
cb5ccee400 [fs][fat] fix a bug in close_dir that forgot to delete dir nodes 2022-04-25 23:17:55 -07:00
Travis Geiselbrecht
c08d540fd6 [lib][fs] add a trace printf when unmounting 2022-04-25 23:17:45 -07:00
Travis Geiselbrecht
f537ff4f9a [lib][unittest] get unittest header working with C++ source
Needed a few cpp header guards in case it was included from C++ source.
2022-04-25 23:17:45 -07:00
Travis Geiselbrecht
5cbe21919b [fs][fat] add header guard to new iterator code header 2022-04-25 00:38:29 -07:00
Travis Geiselbrecht
e615a80993 [fs][fat] reuse directory iterator logic for files
Use the new helper class to also help reading from files efficiently.
2022-04-25 00:28:09 -07:00
Travis Geiselbrecht
b6b82852a2 [fs][fat][test] add a script to create some test block devices
Create a few file systems for fat 12, 16, and 32.
2022-04-23 00:39:33 -07:00
Travis Geiselbrecht
cad9af3420 [fs][fat] add readdir support 2022-04-23 00:27:31 -07:00
Travis Geiselbrecht
011cc61478 [fs][fat] break the dir entry code into a helper routine
Now extract the code to step one entry into a directory into a separate
routine so it can be reused for search and readdir code.
2022-04-22 23:43:30 -07:00
Travis Geiselbrecht
375f5fbfe3 [fs][fat] revamp the directory walk code
Use a new directory iterator routine that tracks the offset within the
directory and handles transitions between sectors and clusters.
Redo the entry parsing code to make a single pass across the long file
names to handle crossing sector boundaries.
2022-04-22 23:03:14 -07:00
Travis Geiselbrecht
9c1c0c6e3f [fs][fat] add a single mutex around the whole FS 2022-04-22 20:27:23 -07:00
Travis Geiselbrecht
ada94e94c7 [fs][fat] get the scaffolding in place for opendir/readdir/closedir
Currently returns a dir handle that reads nothing.
2022-04-22 20:27:23 -07:00
Travis Geiselbrecht
c997cfbc48 [kernel][mutex] Add a default timeout to the C++ wrapper mutex 2022-04-22 20:27:23 -07:00