Commit Graph

281 Commits

Author SHA1 Message Date
Ali Mashtizadeh
e991129de9 Free pages in PMap_Destroy and add extra assertions to catch errors in PAlloc. 2023-09-04 16:03:34 -04:00
Ali Mashtizadeh
3e5eeacf09 Add extra ASSERTs to PAlloc_AllocPage 2023-09-03 14:56:44 -04:00
Ali Mashtizadeh
feb45381ba OSWait: Fix waiting on a specific PID 2023-09-03 14:54:14 -04:00
Ali Mashtizadeh
72341c3c8b Fix WaitChannel_Wake to do nothing if there's no threads to wake up. 2023-09-02 18:41:20 -04:00
Ali Mashtizadeh
d3349d9eaa Adding kernel side Mutex, CV, and testing it with Exit/Wait. 2023-09-02 17:51:10 -04:00
Ali Mashtizadeh
8ce9e523e0 Print currently running threads as well for debugging. 2023-08-30 15:50:41 -04:00
Ali Mashtizadeh
f2b35697a5 Remove warning and cleanup console output. 2023-08-30 13:03:55 -04:00
Ali Mashtizadeh
52377a980c Add waitchannels into the kernel. 2023-08-30 12:49:23 -04:00
Ali Mashtizadeh
67578f14b7 Add lock and malloc annotations to the code. 2023-08-30 12:45:51 -04:00
Ali Mashtizadeh
562cfeec44 x86 ide: Remove unlock in IDE_Identify when failing to select the drive. 2023-08-27 16:57:38 -04:00
Ali Mashtizadeh
91e2e76c91 Add printf checking 2023-08-22 22:03:53 -04:00
Ali Mashtizadeh
06e247a401 Add NO_RETURN to abort and assert functions. 2023-08-22 21:53:26 -04:00
Ali Mashtizadeh
5295c3c8d2 Fix warnings from old style C code. 2023-08-22 18:02:12 -04:00
Ali Mashtizadeh
1df34b2d2e Cleanup loader and unify init and spawn paths. 2023-08-21 22:06:57 -04:00
Ali Mashtizadeh
1676ae4056 Add sched and process to kernel build. 2023-08-21 18:39:26 -04:00
Ali Mashtizadeh
ff7c6309b7 Split up thread.c into thread, process and scheduler files. 2023-08-21 18:38:51 -04:00
Ali Mashtizadeh
e4ca21fa2e Destroy spinlock when destroying the semaphore 2023-08-21 18:36:54 -04:00
Ali Mashtizadeh
1a67c4841b Fix argument passing and cleanup sysctl 2023-08-21 16:57:54 -04:00
Ali Mashtizadeh
765bde0c82 Add basic breakpoint support to kdb 2023-08-21 16:42:29 -04:00
Ali Mashtizadeh
0804766a40 Cleanup logging throughout kernel 2023-08-20 19:08:26 -04:00
Ali Mashtizadeh
45928b97a8 Document initialization on AMD64 2023-08-20 19:06:38 -04:00
Ali Mashtizadeh
c8f6294511 Fix address printing in Debug_HexDump 2023-08-20 19:05:59 -04:00
Ali Mashtizadeh
2718379e6d Add argument passing 2023-08-20 19:04:28 -04:00
Ali Mashtizadeh
febc7b7997 Support loading unaligned binaries 2023-08-16 23:05:52 -04:00
Ali Mashtizadeh
a7c7a06a5b Change debug shell from > to kdbg> 2022-12-10 01:08:36 -05:00
Ali Mashtizadeh
f5eaced208 Add pcilist debug command and bonus cleanup 2022-12-10 01:08:20 -05:00
Ali Mashtizadeh
dfff32378c Style fixes 2022-12-09 23:51:59 -05:00
Ali Mashtizadeh
f86e4ad966 Cleanup and commenting source code 2022-12-09 23:51:45 -05:00
Ali Mashtizadeh
04b709f3b3 Cleanup: Disable LWIP and address compiler warnings 2019-07-31 17:30:50 -04:00
Ali Mashtizadeh
506c559dad Updating copyright for files only touched by me 2018-07-05 16:55:21 -04:00
Ali Mashtizadeh
7bc8169ff2 Fixing some compiler warnings 2015-12-10 12:21:27 -08:00
Ali Mashtizadeh
3e38a6340f Merge branch 'master' of bitbucket.org:mashtizadeh/castor 2015-12-01 15:15:26 -08:00
Ali Mashtizadeh
77ac1468fd Improve logging for shell and fs 2015-12-01 15:15:12 -08:00
Ali Mashtizadeh
c1461694ca Support writing sysctls from userspace 2015-12-01 15:14:17 -08:00
Ali Mashtizadeh
16b21e1406 Allow dumping stack frames and backtraces of any processor. 2015-11-23 14:38:07 -08:00
Ali Mashtizadeh
a274a78a5b Enable interrupts in debug mode so keyboard works. Fixed crosscall off by one due to previous change. 2015-11-20 12:23:36 -08:00
Ali Mashtizadeh
afd9cdc068 Adding sysctl command line tool 2015-11-15 15:17:18 -08:00
Ali Mashtizadeh
ae809dd23a Support setting sysctls from the debugger 2015-11-13 14:43:29 -08:00
Ali Mashtizadeh
069e7b44b7 Fix debugger's CPU halting 2015-11-13 14:41:35 -08:00
Ali Mashtizadeh
1fdc2fd933 Ensure we clear bits we don't want set in cr0 on APs 2015-03-03 16:12:37 -08:00
Ali Mashtizadeh
33af1ed42b Use NMIs to halt all cores when entering the debugger and resume all cores on exit. 2015-02-28 20:18:38 -08:00
Ali Mashtizadeh
2809d233b5 Added a simple crti/n/1 to fix clang compat issues 2015-02-27 15:57:07 -08:00
Ali Mashtizadeh
6a7fd630ce Remove the -N flag that was used when linking the kernel 2015-02-24 16:58:08 -08:00
Ali Mashtizadeh
a357b2f034 Enable saving/restoring XMMs so that Clang works 2015-02-24 16:57:30 -08:00
Ali Mashtizadeh
ce7e8ec194 Assert that spinlocks are locked and unlocked on the same processor 2015-02-16 15:41:32 -08:00
Ali Mashtizadeh
e2afc076a5 Basic CrossCall implementation 2015-02-16 15:19:38 -08:00
Ali Mashtizadeh
8825b399c4 Improve MP debugging 2015-02-16 13:59:24 -08:00
Ali Mashtizadeh
a69bfec37f Brute force try to boot each processor. 2015-02-16 13:52:03 -08:00
Ali Mashtizadeh
a053a30129 Making more functions static 2015-02-16 13:32:14 -08:00
Ali Mashtizadeh
0d335ebe20 Cleanup making internal functions static 2015-02-16 13:23:21 -08:00
Ali Mashtizadeh
2bb2090c93 Remove already fixed comment 2015-02-16 13:11:55 -08:00
Ali Mashtizadeh
473d00e669 Cleanup warnings from all the previous MP changes 2015-02-16 13:04:40 -08:00
Ali Mashtizadeh
e1959cf3f2 Ignore empty lines in kernel debugger 2015-02-16 13:04:22 -08:00
Ali Mashtizadeh
4e4490872e Add missing cleanup code in Process_Destroy 2015-02-16 13:03:57 -08:00
Ali Mashtizadeh
220328dd91 Add MP enhancements for the kernel debugger 2015-02-15 20:17:00 -08:00
Ali Mashtizadeh
d5535ded23 Make spinlock stack per-CPU 2015-02-15 20:05:24 -08:00
Ali Mashtizadeh
4ce2388ef2 Basic multiprocessing seems to be working, but some locking issues may remain 2015-02-15 19:15:18 -08:00
Ali Mashtizadeh
b8c8b1fc7d Improvements for SMP 2015-02-15 18:50:43 -08:00
Ali Mashtizadeh
4808b746f5 Basic MP bootup works 2015-02-15 17:00:55 -08:00
Ali Mashtizadeh
b34f8ed0fd Print backtrace when application faults 2015-02-06 17:08:44 -08:00
Ali Mashtizadeh
251654f2c7 More improvements to support lwip 2015-02-03 14:06:17 -08:00
Ali Mashtizadeh
348a7acc15 Moving some definitions from time.h into sys/time.h 2015-02-02 15:29:12 -08:00
Ali Mashtizadeh
78afc5e47d Header file improvements to enable compiling lwip 2015-02-02 15:10:15 -08:00
Ali Mashtizadeh
73064ffdf6 pthread mutex tests 2015-02-02 13:04:43 -08:00
Ali Mashtizadeh
1ceea3c677 Various bugfixes to Thread_Wait and the pthread library 2015-02-02 11:55:34 -08:00
Ali Mashtizadeh
d729ee868d Fixing compiler warnings 2015-01-30 23:02:18 -08:00
Ali Mashtizadeh
8b45f56bf5 Fix mmap and expose gettid system call 2015-01-30 20:43:28 -08:00
Ali Mashtizadeh
9251a3b7cc ethinject and plumbing for transmitting raw network packets. 2015-01-28 11:35:47 -08:00
Ali Mashtizadeh
8f24dbe6d0 Plumbing for raw packet reading 2015-01-27 10:34:44 -08:00
Ali Mashtizadeh
10bf52f68f A simple ifconfig to show a list of NICs and mac addresses 2015-01-23 13:02:31 -08:00
Ali Mashtizadeh
6f2c8be0ca Removing some excess kprintfs 2015-01-23 12:16:20 -08:00
Ali Mashtizadeh
359d55f53c Removing excess logging and improve semaphore debugging 2015-01-22 15:11:12 -08:00
Ali Mashtizadeh
ccebc2fe60 Finished Process_Wait implementation 2015-01-22 15:00:01 -08:00
Ali Mashtizadeh
9c4761b5f3 Fix thread reference counting leak in Semaphore_Acquire 2015-01-22 14:51:27 -08:00
Ali Mashtizadeh
c80577c5e8 OSWait now waits for child process to exit 2015-01-22 14:11:26 -08:00
Ali Mashtizadeh
534879b0c0 Show lock stack when a spinlock waits too long 2015-01-22 13:52:02 -08:00
Ali Mashtizadeh
ee3874da77 Bug fixes and code cleanup for thread related code 2015-01-22 13:04:43 -08:00
Ali Mashtizadeh
7aaf5cbc5f Adding title to process structure and create default kernel process 2015-01-22 10:08:09 -08:00
Ali Mashtizadeh
fa1b3c9ed2 Fix thread reference counting 2015-01-22 09:46:48 -08:00
Ali Mashtizadeh
63c04f37df Moving to using reference counts for process and thread structures. 2015-01-20 15:30:11 -08:00
Ali Mashtizadeh
2447babe6a Renaming functions and reorganizing functions in thread.c 2015-01-20 15:07:31 -08:00
Ali Mashtizadeh
5808a2564d Implemented CopyStrIn/Out to fix bugginess of using CopyIn/Out wrapping passed a mapped page. 2015-01-19 17:57:20 -08:00
Ali Mashtizadeh
5ed248c8ec Cleanup and fixing warnings 2015-01-19 17:04:14 -08:00
Ali Mashtizadeh
02c0816e41 Adding wait system call 2015-01-18 15:08:12 -08:00
Ali Mashtizadeh
4f15c9fd01 Improvement to ThreadWait 2015-01-18 13:56:15 -08:00
Ali Mashtizadeh
29dd4d3af8 Implement kernel semaphores 2015-01-18 13:48:16 -08:00
Ali Mashtizadeh
4d3eefa3e7 Renaming Timer to KTimer to mach the file names 2015-01-17 13:52:04 -08:00
Ali Mashtizadeh
929784bc52 Adding threadList to process structure. 2015-01-17 13:37:32 -08:00
Ali Mashtizadeh
89ac71a773 Remove unnecessary logging from kern/thread.c 2015-01-16 20:29:45 -08:00
Ali Mashtizadeh
102520ec1b Remove unnecessary logging from kern/thread.c 2015-01-16 20:22:01 -08:00
Ali Mashtizadeh
1160570250 Implemented OSThreadExit and a nonblocking OSThreadWait 2015-01-16 19:41:27 -08:00
Ali Mashtizadeh
db7bb93d56 Adding log message to RTC 2015-01-16 18:48:15 -08:00
Ali Mashtizadeh
5a3d86aa7b Implemented OSThreadCreate system call 2015-01-16 17:57:21 -08:00
Ali Mashtizadeh
114b35bbbc Fix overflow in KTime_GetEpochNS 2015-01-16 17:08:29 -08:00
Ali Mashtizadeh
c408b47966 Keep track of process wait times 2015-01-16 15:25:36 -08:00
Ali Mashtizadeh
6953d03cb3 Fix bug in timer wheel 2015-01-16 15:25:13 -08:00
Ali Mashtizadeh
a01b839b67 Fix bug in KTime_GetEpochNS() 2015-01-16 15:16:44 -08:00
Ali Mashtizadeh
2342aefe9e Support sleep(0) 2015-01-16 14:52:20 -08:00
Ali Mashtizadeh
60799c824e Support thread sleep system call 2015-01-16 14:50:10 -08:00
Ali Mashtizadeh
35b633417f Fix time keeping, TSC ticks per second, and implement generic timer infrastructure. 2015-01-16 14:32:47 -08:00