Commit Graph

204 Commits

Author SHA1 Message Date
Mathieu Maret 0e11da855c Replace cst by its name 2022-08-07 16:20:01 +02:00
Mathieu Maret ed55f1cc23 mem: Correct physical mem for code bank 2022-07-29 00:32:34 +02:00
Mathieu Maret 4e6622d16e alloc: no need from slab >= PAGE_SiZE 2022-07-29 00:17:52 +02:00
Mathieu Maret 7891554d8b move elf in dedicated file 2022-07-25 17:10:28 +02:00
Mathieu Maret fb9bd8df7d Various small fix 2021-11-13 08:31:05 +01:00
Mathieu Maret 9d35a686ab Fix few issues/leaks 2021-11-12 10:19:43 +01:00
Mathieu Maret d1994d44a3 Add locked ring buffer 2021-11-09 20:41:07 +01:00
Mathieu Maret c3b4d65a36 Add semaphore 2021-11-09 15:14:11 +01:00
Mathieu Maret e9e584149c Add support for syscall with more than 3 args 2021-11-09 14:14:06 +01:00
Mathieu Maret 08a9d7442e Add user file size before the file
As a quick fix before FS support
2021-11-08 22:33:15 +01:00
Mathieu Maret 9e528320cf syscall fix variable decl 2021-11-08 22:31:57 +01:00
Mathieu Maret 39cf7ab3ed Add atoi 2021-11-08 22:30:41 +01:00
Mathieu Maret 69d4702696 Remove debug log 2021-11-06 00:17:15 +01:00
Mathieu Maret d3a7ab59b7 Basic shell 2021-11-06 00:13:40 +01:00
Mathieu Maret 288663ad58 Import ringbuffer implementation
From https://git.mathux.org/mathieu/ringbuffer
2021-11-05 23:31:28 +01:00
Mathieu Maret 2b32908029 load userspace from disk 2021-11-05 23:02:23 +01:00
Mathieu Maret 4ad5b58787 Userspace with a syscall 2021-11-04 11:40:53 +01:00
Mathieu Maret a02167ad88 Reduce assert stack depth
This may cause page fault in test
2021-11-03 23:37:44 +01:00
Mathieu Maret e94f87b798 Fix threadSwitch 2021-11-03 09:54:44 +01:00
Mathieu Maret 7b60e1bdac Fix threadSwitch context 2021-11-02 22:00:31 +01:00
Mathieu Maret 84e104d83e Implement some basic syscall 2021-11-02 21:47:05 +01:00
Mathieu Maret 98db8b8962 add context switch in thread 2021-11-02 21:24:12 +01:00
Mathieu Maret 0040fb1cda Add basic test for process 2021-10-30 15:43:40 +02:00
Mathieu Maret 5230b971b2 Add process subsystem 2021-10-30 15:30:19 +02:00
Mathieu Maret e65a57d55d Rename kthread to thread 2021-10-30 14:29:12 +02:00
Mathieu Maret ca4b318df6 rename struct kthread in thread 2021-10-30 14:08:12 +02:00
Mathieu Maret e6524c7d48 Naming fix 2021-10-30 13:58:12 +02:00
Mathieu Maret 79a2bc58ae Integrate MMU context 2021-10-30 00:28:31 +02:00
Mathieu Maret 55e709adb5 allocArea: implement allocPhy failure case 2021-10-29 23:18:15 +02:00
Mathieu Maret 7081fea36d Fix areaAlloc map failing and tests 2021-10-29 17:48:06 +02:00
Mathieu Maret d702c7b60e malloc: fix recursivity with areaAlloc 2021-10-29 12:34:33 +02:00
Mathieu Maret ca399ee782 Modify areaAdd api to be able to do more check 2021-10-28 18:33:02 +02:00
Mathieu Maret be080af906 Fix initial area setup
The inital kernel stack was not page aligned and thus was found in 2
area
2021-10-28 18:19:35 +02:00
Mathieu Maret e658ea6e48 Fix upper area limit 2021-10-28 11:03:44 +02:00
Mathieu Maret 07d173a9c1 Sync PDs on modifications 2021-10-28 00:41:02 +02:00
Mathieu Maret 7b9ceba6b2 Give stack information to area 2021-10-28 00:32:35 +02:00
Mathieu Maret 7f6bb8eef3 add mmu context 2021-10-27 17:36:12 +02:00
Mathieu Maret 46e1bb0642 area alloc: mapping optionnal 2021-10-27 17:30:58 +02:00
Mathieu Maret 2c6ffe34a1 Allow to unref unrefered page 2021-10-27 17:26:49 +02:00
Mathieu Maret 4aa093034b Page fault: more information 2021-10-27 17:20:28 +02:00
Mathieu Maret fbb51dff0f Fix Area research and init size 2021-10-27 17:17:41 +02:00
Mathieu Maret 75dbbdb53b Wrap IRQ, Exception, cpu_context to be ready for user
Fix ASM where ebp was push 2 times.
One by pushw ebp
One by pushal later
2021-10-27 00:14:22 +02:00
Mathieu Maret 8f6f6cf471 WIP: add TSS management 2021-10-25 21:29:18 +02:00
Mathieu Maret 8a53ecfecd VGA: could be configured from MBI 2021-10-25 21:29:02 +02:00
Mathieu Maret 8ff10c938c Improve print information from mbi 2021-10-18 20:39:08 +02:00
Mathieu Maret ddc0c4c84a Wrap IRQ with ASM 2021-10-08 11:24:02 +02:00
mathieu f9d8a4ad29 Merge pull request 'ata' (#2) from ata into master
Reviewed-on: http://git.mathux.org/mathieu/matos/pulls/2
2021-10-06 13:50:10 +02:00
Mathieu Maret 19714126d1 ATA add write and some test 2021-10-06 10:45:03 +02:00
Mathieu Maret a47783ed9c fix ATA disk and controller detection 2021-10-05 21:59:36 +02:00
Mathieu Maret 9c36f3afa2 Add zalloc 2021-10-04 21:20:16 +02:00
Mathieu Maret f2e32cc0fd Add ATA 2021-10-03 23:19:00 +02:00
mathieu 1222c0b998 Merge branch 'master' into areaIntegration 2021-10-01 22:21:31 +02:00
Mathieu Maret 8edaa8646f link slab allocator to areaAlloc 2021-10-01 22:21:11 +02:00
Mathieu Maret a96f72b0af Add alternative memcpy implementation 2021-09-15 21:58:06 +02:00
Mathieu Maret 10d42721e9 Add read_cycle_counter 2021-09-15 21:51:58 +02:00
Mathieu Maret 31aaf10635 bootstrap alloc and area 2021-08-09 14:55:47 +02:00
Mathieu Maret 8bb6cdbad4 Complete details about first 1MB reserved 2021-06-09 22:23:33 +02:00
Mathieu Maret 865d3b811e Rename memDesc to phyMemDesc 2021-04-10 21:53:03 +02:00
Mathieu Maret 4887984322 Thinner phy page pre-booking 2021-04-10 00:24:02 +02:00
Mathieu Maret b077d54e7f WIP: implement basic of alloc area 2021-04-07 16:34:37 +02:00
Mathieu Maret a2d2e1de60 Check malloc return value 2021-04-07 16:34:37 +02:00
Mathieu Maret 4a61d7f3b7 memDesc: change ref as unsigned 2021-02-10 21:15:35 +01:00
Mathieu Maret 3b7543064d alloc: simplify full usage 2021-01-26 08:45:13 +01:00
Mathieu Maret 5ab68d8197 Various cleaning 2021-01-25 20:05:38 +01:00
Mathieu Maret ede53ae4f9 VGA renaming 2021-01-25 14:00:06 +01:00
Mathieu Maret 3f4fb9e952 add asprintf 2021-01-25 10:17:19 +01:00
Mathieu Maret bea3449b11 Implement vsnprintf and use it 2021-01-24 23:51:21 +01:00
Mathieu Maret b305653aac Fix klibc return values 2021-01-24 22:20:43 +01:00
Mathieu Maret 73b721dbc1 Add some mem stat 2021-01-23 21:51:00 +01:00
Mathieu Maret c3d345bb87 Add 64bit printf 2021-01-23 21:21:13 +01:00
Mathieu Maret 8309174f1a Get mem mapping from bootloader 2021-01-23 00:47:06 +01:00
Mathieu Maret 77b495e382 Fix naming and mem bottom 2021-01-22 23:10:07 +01:00
Mathieu Maret a254a7cd71 Fix allocation of too big size 2021-01-16 22:43:43 +01:00
Mathieu Maret 9815cc062f Multiple page allocation 2020-08-28 22:40:21 +02:00
Mathieu Maret ba9e0f1bff protect slub access from multithread 2020-08-21 00:35:33 +02:00
Mathieu Maret c71b0135cf add wq[Init|Free] 2020-08-20 23:41:36 +02:00
Mathieu Maret 5b933a82d3 Implement timeout on wait_queue
fix #1
2020-08-20 23:41:12 +02:00
Mathieu Maret 9c6c4f3470 Fix typo 2020-08-16 00:24:59 +02:00
Mathieu Maret 6922f6dfa4 improve wait_queue api 2020-08-15 23:31:35 +02:00
Mathieu Maret 0f200d1911 Add mutex implementation 2020-07-08 23:08:50 +02:00
Mathieu Maret 1230d738a6 Add %p for printf 2020-07-08 23:03:05 +02:00
Mathieu Maret 5de1c54b61 Move sleep Thread to test 2020-07-06 17:21:49 +02:00
Mathieu Maret 319f197fcd Fix scheduler with sleeping task 2020-05-03 23:13:17 +02:00
Mathieu Maret b1e6bc1aab Fix initial thread status 2020-05-03 23:11:45 +02:00
Mathieu Maret 4b3f928f67 kthreadMsleep implementation wip 2020-05-03 14:45:26 +02:00
Mathieu Maret f7525f9e76 Xsec to jiffies convertion 2020-04-30 23:16:41 +02:00
Mathieu Maret c65c7bb7b0 More more stuff in arch subdir 2020-04-29 23:07:01 +02:00
Mathieu Maret e51314ffac organize by arch 2020-04-27 23:45:38 +02:00
Mathieu Maret 6c3a03a4bc Implement Jiffies 2020-04-27 23:26:22 +02:00
Mathieu Maret 3b97d0307d Style: harmonize formatting
Thanks to: "clang-format -i -style=file **/*.{c,h}"
2020-04-27 00:14:51 +02:00
Mathieu Maret 6cfc8e1c2f kthread: formatting 2020-04-24 23:40:19 +02:00
Mathieu Maret c7feb31c22 Add default exception handler 2020-04-24 23:39:56 +02:00
Mathieu Maret dafaba7407 kthread implement yield 2020-04-24 23:35:57 +02:00
Mathieu Maret b2d3cd62ca alloc: fix free in full slab 2020-04-24 23:28:11 +02:00
Mathieu Maret 0c389afa8f Harmonize kthread func naming 2020-04-24 13:42:47 +02:00
Mathieu Maret 59a8d3b582 Exception handler can access their ID 2020-04-23 23:59:57 +02:00
Mathieu Maret de14e795d6 kthread: implement exit 2020-04-23 23:40:16 +02:00
Mathieu Maret c1b13bc3f4 Improve log at boot 2020-04-23 23:38:20 +02:00
Mathieu Maret 2c0f54926d Initial kthread implementation 2020-04-23 14:49:42 +02:00
Mathieu Maret 5141044c06 use popal/pushal for context switch
Should take fewer clock nd save esp
2020-04-22 17:31:37 +02:00