Commit Graph

23 Commits

Author SHA1 Message Date
Travis Geiselbrecht
3a01e77607 [app][benchmarks] remove all use of floating point to compute speed of bench
Can approximate the calculation with 64bit integer math.
2025-10-12 19:36:10 -07:00
Travis Geiselbrecht
c8f011a159 [lib][libc][tests] move the floating point printf test to libc unittests
Complete moving the rest of the previously manual printf tests out of
app/tests and into lib/libc/test as a proper unit test.
2025-06-10 23:10:45 -07:00
Cody Wong
7cda17edfc [fs][v9fs] Add an example test for VirtIO 9p filesystem
Add a simple test to validate the filesystem APIs that connect the LK
filesystem layer and the virtualIO 9p devices. The test does the same as
`app/tests/v9p_tests.c` to mount the littlekernel codebase folder as the
`/v9p` on the LK filesystem. Then it tries to read the `LICENSE` file
under the codebase and show the first 1024 bytes of the file.

For example:

```
starting internet servers
starting app shell
entering main console loop
] v9fs_tests
0x80017060: 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 |/*. * Copyright
0x80017070: 28 63 29 20 32 30 30 38 2d 32 30 31 35 20 54 72 |(c) 2008-2015 Tr
0x80017080: 61 76 69 73 20 47 65 69 73 65 6c 62 72 65 63 68 |avis Geiselbrech
0x80017090: 74 0a 20 2a 0a 20 2a 20 50 65 72 6d 69 73 73 69 |t. *. * Permissi
0x800170a0: 6f 6e 20 69 73 20 68 65 72 65 62 79 20 67 72 61 |on is hereby gra
...
```

Signed-off-by: Cody Wong <codycswong@google.com>
2024-04-25 00:17:02 -07:00
Cody Wong
db81f606da [tests][v9p] Add an example test for VirtIO 9p device
Add a simple test to validate basic functionalities of the VirtIO 9p
device driver, `dev/virtio/9p`.

For now the test attaches to the first v9p device and try to read the
file `LICENSE` under the shared folder. Therefore, if you set the shared
folder to the git root of `lk`, it will read the `LICENSE` of the
littlekernel and dump it to the console after running `v9p_tests`.

For example:

```
starting internet servers
starting app shell
entering main console loop
] v9p_tests
0x80013c08: 2f 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 |/*. * Copyright
0x80013c18: 28 63 29 20 32 30 30 38 2d 32 30 31 35 20 54 72 |(c) 2008-2015 Tr
0x80013c28: 61 76 69 73 20 47 65 69 73 65 6c 62 72 65 63 68 |avis Geiselbrech
0x80013c38: 74 0a 20 2a 0a 20 2a 20 50 65 72 6d 69 73 73 69 |t. *. * Permissi
0x80013c48: 6f 6e 20 69 73 20 68 65 72 65 62 79 20 67 72 61 |on is hereby gra
...
```

Signed-off-by: Cody Wong <codycswong@google.com>
2024-04-01 23:09:30 -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
Travis Geiselbrecht
80967e78a6 [arch] tweak arch_cycle_count prototype to return a ulong
This lets some arches return a 64bit counter.

As a result of fixing this, removed -Wno-format switch in the test app
which caused the need to fix a lot of printfs.
2020-05-16 17:55:50 -07:00
Girts
61d06e19fc [lib/cbuf] [app/tests] fix off by one in lib/cbuf. add a test.
Previously, if tail was == 0, and we wrote exactly enough bytes to
the end of the buffer, then head would end up at 0 as well. This
would make the buffer instaneously empty, as head == tail.
2016-11-01 21:54:23 -04:00
Travis Geiselbrecht
a7496980c0 [lib][stdio] fix the build after -fbuiltin and io changes 2016-02-07 16:05:46 -08:00
Carlos Pizano
614eaf166a [kernel][ports] Add basic ports functionality
Missing mostly more tests, specifically group tests.

BUG=none
R=travisg@google.com

Review URL: https://codereview.chromium.org/1437453002 .
2015-11-20 14:43:27 -08:00
Travis Geiselbrecht
3b2d7a268b [make] remove the need for a module to manually add $(LOCAL_DIR)/include to the global include path
Pretty much every module in the system was already doing it, so do it
automatically.
2015-10-19 19:07:16 -07:00
Travis Geiselbrecht
ab3e0c147a [app][tests] add a instruction multi issue test, clean up formatting 2015-04-18 14:51:53 -07:00
Shreyas Nagaraj
2ff04720f7 [arch][x86-64] MMU fixes - arch_mmu_query, page walking, kernel ld script 2014-12-11 19:22:37 -08:00
Shreyas Nagaraj
e2a45c32b7 [arch][x86_64] more x86-64 MMU changes 2014-12-11 19:22:37 -08:00
Travis Geiselbrecht
f75fe0b81b [app][tests] add new memory test
-Use the VMM to allocate a large chunk of uncached physical memory
-if no VMM, allocate from heap
-Do a simple own address test then a pattern and moving inversion test
2014-10-23 14:41:44 -07:00
Travis Geiselbrecht
30912e2f26 [app][tests] tests for floating point printf 2014-08-22 00:10:39 -07:00
Travis Geiselbrecht
b0c5c4939d [app][tests] add tests for floating point 2014-06-11 15:01:49 -07:00
Travis Geiselbrecht
f18660a2f4 [app][tests] add quick n' dirty cache test routine 2014-06-03 21:18:09 -07:00
Travis Geiselbrecht
e002c58b59 [make] rename INCLUDES -> GLOBAL_INCLUDES
To be more consistent, rename make variable INCLUDES to GLOBAL_INCLUDES.
Also remove the need to put -I in front of each field, the make system
will do that for you.

To fix your module makefiles:
-Change INCLUDES -> GLOBAL_INCLUDES
-Remove -I prefix
2013-06-07 22:26:06 -07:00
Travis Geiselbrecht
2760f146f5 [app][tests] disable printf formatting warnings for printf test 2013-05-24 20:52:16 -07:00
Travis Geiselbrecht
0fc1b9475d [app][tests] switch the thread tests to the new thread_create mechanism 2012-12-22 15:53:04 -08:00
Travis Geiselbrecht
30e2d00539 [app][test] some benchmarks and a quick clock tester 2012-11-02 12:21:49 -07:00
Travis Geiselbrecht
97cfd0bfa4 [make] update all of the rules.mk to use the new module system 2012-08-31 15:52:24 -07:00
Travis Geiselbrecht
1d0df69964 initial commit of lk (little kernel) project 2008-09-01 02:26:09 -07:00