libjl is a small standard library written from scratch in ARM64 Assembly for Linux.
The purpose of the project is to explore the ARM64 architecture, Linux system calls, and how a custom library can be built without relying on libc. The library is used by example programs, with jlinfo as the end goal.
This project started as an exercise in ARM64 Assembly, but gradually grew into a small standalone standard library and a collection of tools built on top of it.
.
├── include/
│ └── libjl.h
├── src/
│ ├── apps/
│ └── lib/
├── tests/
├── obj/
├── bin/
└── libjl.a
Header files used by C programs and tests.
Declares all public functions exported by libjl.
Examples:
- String functions
- Memory functions
- Linux syscall wrappers
- Helper functions
Contains example programs that use libjl.
Each application is placed in its own directory.
Example:
src/apps/
└── jlinfo/
├── start.S
├── banner.S
├── cpu.S
├── memory.S
└── ...
Each module is responsible for a specific part of the program.
The implementation of the library.
Each function is implemented in its own Assembly file.
Example:
src/lib/
jl_strlen.S
jl_strcpy.S
jl_memcpy.S
jl_write.S
jl_open.S
...
All object files are linked together into the static library:
libjl.a
Tests written in C.
The purpose is to verify that the functions in libjl work correctly by calling the library from a regular C program.
The test suite includes a small custom test framework built around test.c and test.h. These files provide the common assertion helpers and test runner used by the individual test cases.
Example:
tests/
test.c
test.h
test_strlen.c
test_memcpy.c
test_write.c
...
All tests are linked against libjl.a.
Build the library, tests, and applications:
makeRemove all build artifacts:
make cleanThe long-term goal of the project is to build a small but useful ARM64 Assembly library containing:
- String handling
- Memory handling
- Linux syscall wrappers
- Simple I/O functions
- Helper functions for system programs
The library is then used by custom programs, such as jlinfo, to demonstrate its functionality in practice.
The project is under active development and serves at the same time as a practical study of:
- ARM64 Assembly
- Linux ABI
- ELF format
- Linux system calls
- Static libraries
- Linking