Saleem Abdulrasool
2f3e6f5303
pk: correct the handling of SYS_getcwd ( #250 )
`SYS_getcwd` is different from `getcwd` in that the return value is < 0
on failure otherwise it is the length of the string. The proxy kernel
was treating 0 as success and all other values as error. As a result,
we would never return a valid value for `getcwd`.
The following program now executes properly with the Proxy Kernel:
```c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/limits.h>
int main(int argc, char **argv) {
unsigned char buffer[PATH_MAX + 1] = {0};
if (getcwd(buffer, PATH_MAX))
printf("cwd: %s\n", buffer);
return EXIT_SUCCESS;
}
```
5 years ago
Andrew Waterman
b9eba474fb
pk: support >2 GiB of user memory for RV64
Previously, the pk would always run from virtual address MEM_START.
Instead, remap it into the negative virtual addresses, allowing user
processes to expand beyond MEM_START.
5 years ago
Andrew Waterman
0b5ef9cf75
Add some missing syscall stubs
5 years ago
Andrew Waterman
817e7d0dfe
pk: only access user memory through explicit accessors
Enforced with sstatus.SUM.
5 years ago
huaixv
b7f64fe558
Add `statx` syscall ( #234 )
5 years ago
Marcus Comstedt
29539c9aca
Remove use of copy_stat() from sys_fstat and sys_lstat ( #228 )
5 years ago
Marcus Comstedt
c32ca41c81
Remove use of copy_stat() from sys_fstatat
The system call should return the stat struct in kernel format, not
libc format.
5 years ago
davidmetz
efc32d0cab
Fix CPI calcualtion for -s option ( #192 )
This attempt at rounding leads to wrong results, for example:
314689951 cycles
314690101 instructions
0.90 CPI
With my change results in:
314689951 cycles
314690101 instructions
0.99 CPI
I think this was supposed to be part of rounding behaviour but it doesn't work if only the final digit does it and there is no carry...
Instead I changed it to truncate after the second digit
6 years ago
Luís Marques
43969b149e
Implement dup3 syscall ( #162 )
7 years ago
Luís Marques
99d6d0a93f
Make performance counters always 64 bits wide ( #178 )
This prevents the counters from easily overflowing for a 32-bit pk.
7 years ago
Luís Marques
a1c125dde7
Stub out madvise syscall ( #145 )
7 years ago
Luís Marques
31e531b2b4
Implement clock_gettime syscall ( #139 )
7 years ago
Andrew Waterman
e5846a2bc7
Bump the Linux version PK claims to support
This makes it more compatible with recent glibc.
8 years ago
Andrew Waterman
fb4e31229f
Stub out sys_prlimit64
9 years ago
Andrew Waterman
f6b2274af4
avoid non-standard predefined macros
9 years ago
Andrew Waterman
8039c6cacb
For RV32, mmap offset is in 4 KiB increments
10 years ago
Andrew Waterman
558039d546
Add syscall stubs to get through libpthread initializers
10 years ago
Andrew Waterman
0a7862c79f
when -s is passed, print time, instret, cycle, and CPI
10 years ago
Andrew Waterman
d88671efdf
Remove uarch counters
We'll re-add support for the generic performance counter facility once
it exists.
10 years ago
Andrew Waterman
7389e46cd0
Move DRAM to high addresses
10 years ago
Garret Kelly
1baf122e28
pk: proxy chdir syscall to fesvr
10 years ago
Andrew Waterman
ee00503ebe
Don't assume existence of uarch counters
10 years ago
Andrew Waterman
b94c7a4b07
Refactor pk, bbl, machine into separate libraries
Yuck.
10 years ago
Andrew Waterman
80447e5711
Disentangle PK and BBL a bit
10 years ago
Andrew Waterman
7016bac5df
Fix struct stat size mismatch for RV32
10 years ago
Andrew Waterman
31ad71b8a4
Remove incorrect code supporting ELF32 on RV64 and vice-versa
This is technically possible by running an RV32 supervisor on an
RV64 machine, but the M-mode and S-mode code would need to be
compiled and linked separately.
10 years ago
Colin Schmidt
676c953b79
add renameat syscall
10 years ago
Andrew Waterman
4a37572381
Add ftruncate syscall
11 years ago
Andrew Waterman
cc3a93bf30
Stub out a few system calls
11 years ago
Andrew Waterman
87683e74f5
Split pk functionality into pk and bbl
pk is now an AEE only (i.e. it can only execute user programs).
bbl is now an SEE only (i.e. it can only host kernels).
11 years ago
Andrew Waterman
6517fe26a2
Update to new privileged spec
11 years ago
Andrew Waterman
5c86450130
work in progress on new supervisor spec
11 years ago
Andrew Waterman
d05359c14e
return -ENOSYS for ioctl, rather than aborting
11 years ago
Andrew Waterman
0a81fd3a93
Support linkat, unlinkat, mkdirat syscalls
Also, old-style syscalls e.g. open are now implemented with e.g. openat.
11 years ago
Andrew Waterman
fda0d85ae4
Don't rely on the C library
12 years ago
Andrew Waterman
1d953bf6fc
Support glibc 2.20 programs
12 years ago
Christopher Celio
024053cd98
Fix uarch counter printout type.
12 years ago
Christopher Celio
5eba64df88
Added "-c" option to track uarch counter info.
12 years ago
Christopher Celio
7b6a968c83
Changes to allow spike & RTL behavior to better match each other.
- EI turned off on sys_exit.
- IM/IP cleared on start.
- badvaddr only saved to tf on page faults.
12 years ago
Colin Schmidt
8fc3a35ba5
Allow mmap to map new segments larger than 1 page on top of existing mappings and add mprotect syscall
12 years ago
Colin Schmidt
e50dc18f5d
Add several syscalls, and move syscall header file from newlib
syscalls added (openat, access, accessat, faccessat, etc.)
12 years ago
Andrew Waterman
f1f8dbbed0
Abandon MIPS convention for indicating syscall errors in register a3
12 years ago
Andrew Waterman
dc49b2b13a
Add times syscall
12 years ago
Andrew Waterman
f62e692e72
Update to new privileged ISA
13 years ago
Andrew Waterman
6c0a4423c5
Add gettimeofday syscall
13 years ago
Andrew Waterman
00f7299824
Add some syscalls
13 years ago
Andrew Waterman
80a4afcb47
Remove extraneous printk
13 years ago
Andrew Waterman
cc72987e65
Support Linux ABI and (optionally) virtual memory
13 years ago
Andrew Waterman
accebe9e63
add BSD license
13 years ago
Andrew Waterman
8717517e04
Synced up PK with supervisor changes/asm syntax
You must upgrade to the latest compiler and ISA
simulator to build and run this version of the PK.
15 years ago