This allows other components to reference basic UEFI types. Now
different platforms can provide their own override for certain UEFI
protocols.
To keep good include structure, all public headers are put under
include/uefi.
This function was previously put in anon namespace, making it
unavailable for other source files to consume. Since we made this
function an API for consumption, move outside anon namespace so
that linkers can find it.
A large pile of changes to the PC platform and x86 architecture that
facilitate SMP support. Tested in both 64 and 32bit on qemu and real
hardware all the way back through i486.
For LK_DEBUGLEVEL > 1
> alloc_struct_begin_size: 24
> free_heap_chunk_size: 24
size: max(alloc_struct_begin_size, free_heap_chunk_size)
But when freeing the chunk, allocated size is expected to be
greater than size of free_heap_chunk struct.
It contradicts its own code.
So add >= instead of > to maintain the integrity between
allocation and freeing of memory chunk.
Signed-off-by: vivek.j <vivek.j@samsung.com>
GCC 14 is quite picky about warnings, probably more so than clang.
-Fix a bunch of printf warnings. Pointers should be printed with %p.
-Move some stuff into an anonymous namespace.
-Worked around GCC really not liking reinterpret_casting from one
function pointer type to another. Fiddled with it a bit and eventually
settled on casting the function pointer to const void * and passing it
through.
This change updates the `help` console command to list the available
commands alphabetically, but only when we're not panicking. This makes
`help`'s helping more helpful.
This loads all sections specified by PE header at the correct memory
location, and executes the entry point function. Only the
OutputString function of text output protocol is implemented,
so the only application we can run is hello world.
Test: th
Bug: 294283461
Change-Id: I786bc8b7db9e1c0a6019b8fe4ba5a8c8ab4f2936
These headers define the API boundary between UEFI loader and
UEFI applications.
Test: th
Bug: 294283461
Change-Id: Idf064563bb033a8bf2b994261bcd77c0ed7aa2d8
Thids adds a uefi_load <block dev name> command, which will
parse the PE header and do some basic validation checks.
Bug: 294283461
Test: uefi_load virtio0
Change-Id: I97393652526bda5be1b995e59647e239c64d31d6
It's just a test routine that's using floating point, but since nothing
in cmpctmalloc should be used in interrupt context, it should be okay to
mark this code as using float.
- Add the file operations APIs for VirtIO 9p devices, such as file
create/open/close/read/write/stat.
- After this commit, almost complete file operations for v9p file
sharing are supported. An intuitive example is that users can use
filesystem commands, such as `ls`, to examine the shared folder.
Example:
```
# Build the littlekernel with the current directory (the codebase) as
the shared v9p folder
$ scripts/do-qemuarm -f .
...
welcome to lk/MP
boot args 0x0 0x0 0x0 0x0
INIT: cpu 0, calling hook 0x8011fa81 (version) at level 0x3ffff,
flags 0x1
...
# Mount the default VirtIO 9p device `v9p0` as the 9p filesystem onto
# `/v9p` path
] fs mount /v9p 9p v9p0
# List the `/v9p` folder, and we can see the littlekernel codebase
] ls /v9p
D 4096 arch
F 590 lk_inc.mk.example
D 4096 .cache
D 4096 project
D 4096 .github
D 4096 platform
D 4096 kernel
D 4096 external
F 1132 LICENSE
D 4096 target
D 4096 dev
D 4096 .git
F 120 .gitignore
F 12579 engine.mk
F 1388 README.md
D 4096 make
D 4096 top
error -2 opening file '/v9p/..'
D 4096 build-qemu-virt-arm32-test
F 763965 compile_commands.json
D 4096 scripts
D 4096 lib
D 4096 app
D 4096 docs
D 4096 .
D 4096 tools
F 1113 makefile
```
Signed-off-by: Cody Wong <codycswong@google.com>