summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
3 daysoasm: Add stdbool.h includesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysoasm: Unreserve 9 opcode gapIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysoasm: Add table to keep track of labelsIan Moffett
Implement a hash table used to store a maximum of 128 labels. This commit adds functions such as label_enter() to add labels to the table, label_lookup() to lookup labels as well as various utility functions used internally by the assembler. Signed-off-by: Ian Moffett <ian@osmora.org>
3 dayssys: queue: Include user headers ifndef _KERNELIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysetc: Add usage of MROW instruction in test-00.sIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysoemu: cpu: Add decoding logic of MRO instructionsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
3 daysoasm: Add encoding for MRO type instructionsIan Moffett
This commit introduces encoding logic for 4 additional instructions: - MROB (Mask Register Over [byte]) - MROW (Mask Register Over [word]) - MROD (Mask Register Over [dword]) - MROQ (Mask Register Over [qword]) This instruction is used to fill a register with a specific length of zeros or ones. For example, to fill a register (e.g., x2) with 16-bits of 1s: -- !! !! Clear bits x2[7:0]... Mrrp,, !! mrow!! !! mrow x2, #1 -- Similarly, an operand of zero sets it to zero. For example, to clear an entire 64-bit register with zeros. Something like this can be done: -- mroq x1, #0 -- Signed-off-by: Ian Moffett <ian@osmora.org>
4 daysoasm: parse: Remove unused stubIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
4 daysoasm: Add initial support for labelsIan Moffett
A label is like a pin on a map with a number attached to it. OASM keeps track of a number referred to as the psuedo instruction pointer (PIP). This value is initially zero by default and is incremented every instruction. The purpose of this value is to pin a location in the code and mark it to be at a specific address so that further references to that label would be translated to the previous PIP value at the time of encountering the label. Signed-off-by: Ian Moffett <ian@osmora.org>
4 daysusr: Add 'oasm' and 'oemu' to the build listIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
4 daysoasm: parse: Use oasm_err instead of printf()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysbuild: Add tests for oasm and oemu in etc/oemu/Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add support for '!' commentsIan Moffett
Introduce comments, example usage: -- !! !! Double the X5 register by using the !! MUL instruction. !! mul x5, 2 !! wow -- Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: cpu: Decode the BR instructionIan Moffett
Add support for interpreting the BR (branch) instruction. This instruction takes in a single register operand containing an address to reassign the instruction pointer to. Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: types: Add addr_t typeIan Moffett
The addr_t type represents any kind of memory address. We also assign paddr_t to addr_t. Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add encoding for BR instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: cpu: Add link registers and SR_STATEIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: cpu: Add CPU register dumpIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: cpu: Introduce decoding logic for DIVIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Add encoding logic for "DIV" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoemu: cpu: Introduce decoding for MUL instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: Introduce encoding for MUL instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
5 daysoasm: 'osxm64' -> 'osmx64'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoemu: cpu: Introduce decoding logic for SUBIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Add encoding logic for "SUB" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoemu: cpu: Decode and process HLT instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Parse and encode the "HLT" instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoemu: cpu: Decode ADD instructionsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: Implement encoding for 'ADD' instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Remove extra whitespaceIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Remove extra newlineIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysproject: Bump version to 2.4Ian Moffett
- [kernel]: Avoid make panic screen configurable [0] - [kernel]: Avoid using kprintf() during panic [1] - [kernel]: Add sys/crypto/* [2] - [kernel/amd64]: Get CPU family and model number [3] - [kernel/amd64]: Track interrupt count [4] - [usr: libc]: Add math.h + musl math impl port [5] - [sys]: Add 64-bit atomic operations in sys/atomic.h [6] - [kernel: sched]: Sort out MI/MD context switch logic [7] - [kernel]: Add kernel accounting information [8] - [usr]: Add 'kstat' program [9] - [kernel: sched]: Add support for CPU pinning [10] Commits referenced: [0]: 85ddd63bddfa20bedce3a387c69dcf66f882a8ea [1]: a789a2d36560f64952dcfc25d330f1ac04206c14 [2]: 2a93cf52e5386eb1b3586565af6a06ade4d32a66 [3]: 2f1902f6e554f6bc36b5a3e4cf8add8c3e5197cc [4]: 25d4aca4bf49bdbee6a7a35ef5d63ae45138ddf5 [5]: 30634165980deaeead9f4e71e0ff6a5c9d897776 [6]: a66c3f8d3d1f70beb3147999db21229803eb7021 [7]: f6900b5c3b4832f48359fd761b80f8693a6735e8 [8]: 8a3973e46941b6a8c88a49594364a04ee4b1d84e [9]: d6bd4640721867f59d89c68fddb15098524c56c8 [10]: 3c9e0969840d47a812f5e65fa43f694f2e7f3ff3 ... Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysusr: Add initial OSMX64 emulator sourcesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Handle increment/decrement operationsIan Moffett
Implement the initial encoding logic for INC/DEC instructions. Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Add 'unused' field to instructionIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 dayskernel: tmpfs: Fixup real_size computationIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Fix typoIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: parse: Add TT_INC to parse_tok()Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
6 daysoasm: emit: Don't use TAILQ_FOREACH for processingIan Moffett
In order to have more control over the flow at which we grab the next tokens, we should roll our own loop by hand using TAILQ_FIRST() and TAILQ_NEXT() Signed-off-by: Ian Moffett <ian@osmora.org>
7 dayskernel: subr: Check uaddr against mmap ledgerIan Moffett
When validating memory addresses coming from userspace, we currently only check if it is within range of the program stack or data. However, data may also be allocated in the heap which involves addresses stored in the memory map ledger. In order for user programs to be able to pass references to that kind of memory to syscalls, we must be able to check the addresses against ledger entries as well. Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysoasm: Add initial codegen emit sourcesIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysbuild: Remove 'BLACKLIST'Ian Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysoasm: Open and grab fd for binary output fileIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysoasm: parse: Add tok_is_xreg() helperIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysoasm: lex: Convert and store <imm> to uint16_tIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysoasm: lex: Free tokenstr on errorIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysusr: oasm: Free pointers on error pathsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysusr: oasm: Add initial parsing logicIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysusr: oasm: Add IMM tokstr entryIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>
7 daysusr: oasm: Lex registers and operandsIan Moffett
Signed-off-by: Ian Moffett <ian@osmora.org>