Commit Graph

1388 Commits

Author SHA1 Message Date
K. Lange
6ceb9392cd tty: fix permanently set EOF status on tty 2022-03-22 14:10:30 +09:00
K. Lange
5caf43d90a kernel: x86-64: copy over unmap improvements from aarch64 2022-03-16 08:39:33 +09:00
K. Lange
00075494e6 kernel: aarch64: initial pass at clearing upper page structures on unmap
This still has thread issues, but a lot of other things need to be
redesigned to correct them.

Particularly, we have a lot of callers that use `mmu_get_page` without
acquiring any locks on the page directory, so in a multithreaded process
one core may be trying to acquire pages while another is unmapping. In
the normal sbrk setup, this shouldn't happen, especially with the locks
in userspace around malloc, and it shouldn't happen with shm as we avoid
dealing with shm pages in the unmap right now, but from the raw API we
provide it's possible for a crafted program to run into it.

The whole memory management API really needs a redesign, much of what we
expose comes from toaru32, and still leaks details about page size into
other code that shouldn't care.
2022-03-16 08:19:36 +09:00
K. Lange
2262c0b2bc procfs: expose heap break point in /proc/{PID}/status 2022-03-16 08:17:50 +09:00
K. Lange
b297ab3fed kernel: improve comments in sys/ptrace.c 2022-03-13 16:07:53 +09:00
K. Lange
9f7a84c0fc kernel: improve comments in sys/signal.c 2022-03-13 15:13:14 +09:00
K. Lange
58a1b6e999 pthread: Remove magic thread exit; pthread_exit() is just syscall_exit 2022-03-12 18:46:28 +09:00
K. Lange
4bcd1b4b89 aarch64: apply e1000 permission changes 2022-03-07 18:08:54 +09:00
K. Lange
2700849ca2 aarch64: clear instruction cache on new pages when forking 2022-03-07 09:20:19 +09:00
K. Lange
523a3a0159 kernel: packetfs: handle -ERESTARTSYS from underlying pipe 2022-03-06 16:22:48 +09:00
K. Lange
4c2ec1f0a0 kernel: add a temporary 'munmap' sysfunc 2022-03-06 15:58:38 +09:00
K. Lange
49fd67bf2d kernel: relocate some user virtual addresses 2022-03-06 15:58:08 +09:00
K. Lange
f778967edb aarch64: disable lock debugging 2022-03-06 15:56:53 +09:00
K. Lange
e37207828a kernel: print more details when trying to alert invalid process 2022-03-04 22:09:31 +09:00
K. Lange
cd04af0a75 aarch64: remove some debug messages 2022-03-04 22:08:05 +09:00
K. Lange
d932559d79 kernel: ensure we're saving/restoring all process state on signals 2022-03-04 22:04:11 +09:00
K. Lange
6ff1bc5195 kernel: clear signal disposition when running a handler, as we should 2022-03-04 22:03:21 +09:00
K. Lange
e07291a0b1 kernel: More lock fixes around pipes... 2022-03-04 22:01:13 +09:00
K. Lange
63fbbec928 kernel: Don't let things clear frames without holding the frame alloc lock 2022-03-04 22:00:37 +09:00
K. Lange
3852646174 kernel: Restart some signals, fix up suspend to work with new signal management 2022-03-04 18:39:38 +09:00
K. Lange
bbebc7c128 kernel: complete redesign of signal handling 2022-03-04 16:12:16 +09:00
K. Lange
b3f6728339 date: add rudimentary support for setting date/time 2022-02-25 21:16:30 +09:00
K. Lange
7d2beb443b aarch64: expose dtb as a device file 2022-02-23 20:40:53 +09:00
K. Lange
b29edb0db3 rpi400: mini uart driver 2022-02-23 16:33:30 +09:00
K. Lange
94b86558d3 aarch64: cleanup, fix warnings 2022-02-23 10:27:47 +09:00
K. Lange
c96bae5e78 aarch64: temporary device drivers until modules are ready 2022-02-23 10:24:15 +09:00
K. Lange
5a6648a869 rpi400: try to clean up rpi stuff 2022-02-23 09:49:16 +09:00
K. Lange
814f5210ae aarch64: cleanup some warnings 2022-02-22 17:30:17 +09:00
K. Lange
6c69d235cf aarch64: implement a better spinlock 2022-02-22 09:53:55 +09:00
K. Lange
4946a0bf5a aarch64: reset timer on entry into idle wait 2022-02-22 09:53:30 +09:00
K. Lange
4cc4d9520e aarch64: force task switch when idle gets wakeup signal 2022-02-22 09:53:04 +09:00
K. Lange
5019c047c5 aarch64: expose aarch64_interrupt_dispatch as a symbol 2022-02-22 09:52:37 +09:00
K. Lange
c180959f4e aarch64: idle task loops should be the same for BP and APs 2022-02-22 09:51:56 +09:00
K. Lange
2543e2ce0c aarch64: this seems to be necessary or hvf can occasionally throw a fault on syscall return? 2022-02-20 18:12:29 +09:00
K. Lange
59c92182b4 aarch64: save/restore fpu status registers 2022-02-20 18:12:02 +09:00
K. Lange
255b2296fd aarch64: implement panic halting with sgis 2022-02-20 18:11:24 +09:00
K. Lange
975b388962 rpi400: smp startup 2022-02-18 18:44:23 +09:00
K. Lange
4c13c92180 rpi400: request maximum clock speed at startup 2022-02-16 19:43:25 +09:00
K. Lange
7fc07996d1 rpi400: fbterm: only do that on arm 2022-02-16 12:38:51 +09:00
K. Lange
116ee0a803 rpi400: initial platform support 2022-02-16 12:36:03 +09:00
K. Lange
54cd122d3e aarch64: virtio: be even pickier about cache maintenance 2022-02-13 18:29:57 +09:00
K. Lange
62b0b216d6 kernel: more lock ordering shenanigans 2022-02-13 14:44:09 +09:00
K. Lange
6b35dab7da kernel: fix faulty lock around sleep nodes not capturing potential change in owner 2022-02-12 17:51:24 +09:00
K. Lange
ce4bf5162a aarch64: mmu: be more paranoid about frame allocation/clearing 2022-02-12 17:50:45 +09:00
K. Lange
1695ca6652 aarch64: traceback: fix incorrect base pointer on manual traceback 2022-02-12 17:50:21 +09:00
K. Lange
595727be1d aarch64: virtio: make sure irq handler symbols are in our table for debugging 2022-02-12 17:49:58 +09:00
K. Lange
ae28f8f832 aarch64: fixup warning about discarded volatile 2022-02-12 13:49:32 +09:00
K. Lange
33f0204c0a aarch64: mmu: fix up insufficient locking around mulitlevel page mapping 2022-02-12 13:47:22 +09:00
K. Lange
41bdb25715 aarch64: remove superfluous reload of TTBR1 2022-02-12 13:47:22 +09:00
K. Lange
f6d0206059 aarch64: interrupt mapping improvements, chained interrupt handlers 2022-02-12 13:47:21 +09:00
K. Lange
b95f27dc60 aarch64: Add a tty driver for the pl011 uart 2022-02-11 11:55:36 +09:00
K. Lange
85274e61ad aarch64: cleanup 2022-02-11 11:54:28 +09:00
K. Lange
8062fdda17 aarch64: fix mmu_first_n_frames since ram moved 2022-02-09 23:14:50 +09:00
K. Lange
a72352d163 aarch64: start work on interrupt dispatch 2022-02-09 21:02:00 +09:00
K. Lange
8c7e6209f4 aarch64: increase inital stack size for kernel startup 2022-02-09 21:01:26 +09:00
K. Lange
b55964e451 aarch64: flip smp mutex after doing init for better startup synchronization 2022-02-09 21:01:09 +09:00
K. Lange
2c5a6db126 procfs: avoid crashes on empty module, filesystem tables 2022-02-07 12:47:58 +09:00
K. Lange
1ed8ba466c aarch64: Actually reset kernel stack on exec 2022-02-07 12:46:13 +09:00
K. Lange
82090737dd aarch64: basic kernel tracebacks on el1-el1 fault 2022-02-07 12:38:30 +09:00
K. Lange
9f03252e3a aarch64: Load kernel symbol table 2022-02-06 21:23:35 +09:00
K. Lange
e1e66bf6cd aarch64: be more flexible about where the kernel is physically 2022-02-06 21:10:20 +09:00
K. Lange
097662ef3d x86_64: fix segfault not being delivered due to cow regression 2022-02-06 15:04:21 +09:00
K. Lange
92ae583c5b aarch64: smp: reorder barriers before enabling MMU 2022-02-03 17:48:51 +09:00
K. Lange
3368796328 aarch64: retrieve MIDR per-core 2022-02-03 08:27:33 +09:00
K. Lange
07e97e2784 aarch64: A better memcpy for arm 2022-02-03 08:15:02 +09:00
K. Lange
afab2320bf aarch64: SMP 2022-02-03 00:08:47 +09:00
K. Lange
187b331e9e ptrace: fix delivery of final signals, improve dbg 2022-02-02 20:53:23 +09:00
K. Lange
4c04e01f61 aarch64: basic tracing support 2022-02-02 20:52:56 +09:00
K. Lange
ca7c67ca5d aarch64: signal delivery 2022-02-02 17:37:09 +09:00
K. Lange
7238f0f2a5 aarch64: virtio: bind more keys, scroll wheel 2022-02-02 16:11:35 +09:00
K. Lange
10010578bf aarch64: Fixup cpuinfo, improve cpu-name 2022-02-02 13:22:20 +09:00
K. Lange
79bd90e44c aarch64: Start calling this 2.1.0 2022-02-02 12:56:55 +09:00
K. Lange
0bb91b0edb aarch64: split up assembly, add more comments 2022-02-02 12:49:04 +09:00
K. Lange
18a4e78336 aarch64: More cleanup 2022-02-02 12:08:44 +09:00
K. Lange
d3b4b6fab2 aarch64: virtio input devices, nearly complete 2022-02-01 17:06:07 +09:00
K. Lange
e8d78f00fc aarch64: reorganize 2022-02-01 13:27:49 +09:00
K. Lange
981d578ad3 aarch64: Initial timer interrupt support 2022-02-01 13:01:59 +09:00
K. Lange
fb578d9ae5 aarch64: procfs things 2022-02-01 08:29:01 +09:00
K. Lange
bf40d8f289 aarch64: some memory size management 2022-02-01 06:54:59 +09:00
K. Lange
f0d7ed7743 aarch64: fixup clone(), add mmu_free(), cache stuff for ld.so 2022-01-31 21:08:11 +09:00
K. Lange
c3311fe272 insmod: not available on aarch64 yet 2022-01-30 21:35:46 +09:00
K. Lange
4f510c7fef x86_64: fixup include paths; mmu.h is shared now 2022-01-30 21:28:10 +09:00
K. Lange
b53a56fe72 aarch64: begin work on new target 2022-01-30 21:25:27 +09:00
K. Lange
442d61ae5e gzip: Some const correctness maybe helps 2022-01-12 18:52:52 +09:00
K. Lange
19508075e4 kernel: Don't mark process running if it is exiting... 2022-01-08 17:44:39 +09:00
K. Lange
d7595b2b81 v2.0.1 2022-01-04 08:35:14 +09:00
K. Lange
cac1eca676 kernel: extend kernel heap sbrk sanity check
We use sbrk() to set up the memory for physical page
reference counting, and the previous limit was causing
panics on boot with >60GB of RAM. Oops.
2021-12-12 12:55:09 +09:00
K. Lange
0d9dbb80fc base: Prepare for 2.0.0 2021-12-06 11:32:23 +09:00
K. Lange
0c6f58277c v1.99.10 2021-12-01 21:32:59 +09:00
K. Lange
345a6312db kernel: Possibly fix sporadic lockup in compositor? 2021-12-01 20:17:55 +09:00
K. Lange
658ae81f65 kernel: cleanup things introduced in COW 2021-12-01 09:19:25 +09:00
K. Lange
18174e46de kernel: Implement basic copy-on-write for fork() 2021-11-30 22:26:45 +09:00
K. Lange
de0bda736a kernel: at least add full lead comments to everything 2021-11-26 11:31:10 +09:00
K. Lange
c572a5c148 kernel: clean up kernel/arch/x86_64/{cmos,pit}.c 2021-11-26 11:05:46 +09:00
K. Lange
574267fd1a kernel: cleanup kernel/generic.c 2021-11-26 10:29:28 +09:00
K. Lange
e6313efcfc kernel: cleanup kernel/arch/x86_64/user.c 2021-11-26 10:28:23 +09:00
K. Lange
35423ecc66 kernel: cleanup kernel/arch/x86_64/smp.c 2021-11-26 10:27:39 +09:00
K. Lange
80cf1a1f15 kernel: cleanup kernel/arch/x86_64/idt.c 2021-11-26 09:52:05 +09:00
K. Lange
5b16cd6ce4 kernel: bad ordering of list insert / wakeup caused crashes 2021-11-24 17:34:06 +09:00
K. Lange
ade7d13707 x86_64: fixup bad memory walk when doing backtraces 2021-11-24 17:33:38 +09:00
K. Lange
045431b2de kernel: prevent modules from being loaded multiple times 2021-11-18 19:47:28 +09:00
K. Lange
fb30aae90d tarfs: throw EROFS on create 2021-11-17 19:18:56 +09:00
K. Lange
d90d6e1963 kernel: Add simple mutex with a wait queue 2021-11-17 19:13:33 +09:00
K. Lange
f3759daadf ioctl: request should be 'unsigned long' 2021-11-15 21:51:33 +09:00
K. Lange
f7a29b90af kernel: Use local APIC timer for preemption on APs, not an IPI 2021-11-14 17:16:20 +09:00
K. Lange
697200013a v1.99.9 2021-11-09 13:28:16 +09:00
K. Lange
a5079f93b0 lfbvideo: Keep resolution set by loader if none specified by args 2021-11-05 07:53:35 +09:00
K. Lange
43b6bd32e3 kernel: exclude serial ports from pts numbering; start numbering at 1 2021-11-04 19:17:21 +09:00
K. Lange
96cb5d9c01 lfbvideo: Don't map EGA/VGA text mode range as WC as apparently things don't like that 2021-11-01 19:07:09 +09:00
K. Lange
ac35ad0bbd x86_64: Don't wrap version codename in quotes as we're doing that directly now 2021-10-30 15:24:36 +09:00
K. Lange
119c42077d kernel: Put codename string in quotes for stylistic reasons 2021-10-30 08:53:49 +09:00
K. Lange
d6fc131912 kernel: Export sys_ functions so they appear in symbol table 2021-10-28 07:51:20 +09:00
K. Lange
a83d641d2c mmu: Be more clear about what's happening when we run out of RAM 2021-10-28 07:48:25 +09:00
K. Lange
d79bf46731 fbterm: Move log to center, set bg to black 2021-10-26 16:14:38 +09:00
K. Lange
49342b7996 net: try to actually track received packet sizes... 2021-10-25 18:27:08 +09:00
K. Lange
073e43384c kmalloc: Use existing assertion infrastructure 2021-10-25 18:25:21 +09:00
K. Lange
4b62e4ab22 assert: use dprintf, not printf, when printing assertion message 2021-10-25 18:24:49 +09:00
K. Lange
465c82a5f8 irq: Mark isr_common as global so it shows up in symbol table 2021-10-25 18:23:50 +09:00
K. Lange
1bb382de12 kernel: Print gs alongside other registers in panic 2021-10-25 18:23:33 +09:00
K. Lange
95ef9f02ac fbterm: Support 24bpp framebuffers 2021-10-25 13:50:08 +09:00
K. Lange
8839e4357c multiboot: Correctly pass bits-per-pixel from framebuffer data 2021-10-25 13:49:57 +09:00
K. Lange
f0091f8f87 ringbuffer: don't use heap allocator if buffer size is one page 2021-10-24 19:52:51 +09:00
K. Lange
591a074608 pipe: Embiggen pipe buffers 2021-10-24 19:39:42 +09:00
K. Lange
e3b713487c pipe: Make pipes more direct with ring buffer usage 2021-10-24 18:12:20 +09:00
K. Lange
ca8fc639db kernel: Fix gdt install clobbering symbol table, or whatever else ends up after it 2021-10-24 16:23:56 +09:00
K. Lange
ce1e9b4e03 socket: Purge rx queue when socket closes? 2021-10-23 12:42:48 +09:00
K. Lange
8b363c878b mmu: Fixup mapping for physical memory address >4GiB 2021-10-23 12:19:41 +09:00
K. Lange
1ed5ea6404 net: net_udp_send() should return size of data sent 2021-10-22 15:39:21 +09:00
K. Lange
f300386d13 net: initial loopback interface support 2021-10-22 15:36:03 +09:00
K. Lange
3decb96169 v1.99.8 2021-10-21 11:18:42 +09:00
K. Lange
08820eca71 kernel: oops 2021-10-21 09:35:02 +09:00
K. Lange
bf6d5f765d kernel: make_process_ready may be called with sleep_lock already acquired? 2021-10-21 08:48:26 +09:00
K. Lange
55835ab494 fbterm: Only enable scrolling by default on vga terminal 2021-10-20 19:39:47 +09:00
K. Lange
1efc36e51a kernel: Fixup bad lock ordering in process_awaken_signal 2021-10-20 19:37:31 +09:00
K. Lange
b6caef5d7e x86_64: Cleanup boot messages to fit in vga text mode better 2021-10-20 18:49:40 +09:00
K. Lange
0f2d7334b0 fbterm: VGA backend, enable scrolling by default 2021-10-20 18:49:07 +09:00
K. Lange
038727eb1a x86_64: Support multiboot2 loaders 2021-10-20 16:03:05 +09:00
K. Lange
043b3797f7 x86_64: Mark kernel with AOUT_KLUDGE address parameters so the 64-bit ELF can be booted directly 2021-10-20 16:02:46 +09:00
K. Lange
76191f89fb kernel: Print tracebacks for more fatal errors 2021-10-20 10:33:58 +09:00
K. Lange
32c3bf1825 insmod: Support passing arguments to modules 2021-10-20 10:33:35 +09:00
K. Lange
c366ea2dfd kernel: Initial pass at new debug printf interface 2021-10-19 20:29:14 +09:00
K. Lange
7ce16a005d net: Oops, we broke UDP sends 2021-10-13 10:50:05 +09:00
K. Lange
526c8fc55e smp: allow command line override for where to scan for RSDP 2021-10-12 22:23:58 +09:00
K Lange
751f78ef2f net: don't explode without a network 2021-10-12 21:15:44 +09:00
K. Lange
a8ca76845c smp: Don't just fatal() if there's too many cores; initialize up to 32 2021-10-12 20:04:38 +09:00
K Lange
72825a7d46 lfbvideo: recalculate vmware memory size on display change 2021-10-09 22:06:31 +09:00
K. Lange
05e224dee7 kernel: Better fault reports 2021-10-04 20:34:42 +09:00
K. Lange
495d1a196a kernel: Use 'Misaka' as the system named presented by the kernel 2021-09-30 10:37:46 +09:00
K. Lange
1f0d982240 kernel: Initial try at actual user buffer validation 2021-09-29 14:07:32 +09:00
K Lange
62368bbf44 tcp: Fixup socket receive buffers 2021-09-27 21:09:28 +09:00