Commit Graph

421 Commits

Author SHA1 Message Date
08ba0154f7 Add a bin loader 2023-03-27 18:10:11 +02:00
François Autin
7f37965ed4
♻️ Implement From<&str> and From<String> traits to MachineError, and simplified opiw_instruction 2023-03-27 15:56:23 +02:00
François Autin
2162232199
♻️ Simplified branch_instruction 2023-03-27 15:37:30 +02:00
François Autin
ff93fab832
♻️ Amend of previous commit 2023-03-27 15:01:34 +02:00
François Autin
288703321e
♻️ OPI instruction done 2023-03-27 14:59:22 +02:00
François Autin
ba8e36ea90
:rotating_lights: Small lint fixes 2023-03-27 11:35:04 +02:00
François Autin
939e23883e
♻️ Simplified OPI 2023-03-27 11:22:53 +02:00
François Autin
a8bbc13142
🐛 Readded check for system instructions in order to pass tests 2023-03-27 10:34:10 +02:00
François Autin
8ba63d38a3
♻️ Main loop now panics on error 2023-03-27 10:21:18 +02:00
François Autin
e77e125f96
♻️ Error management and simplification
Modified methods
 - load_instruction
  - store_instruction
2023-03-25 15:57:28 +01:00
François Autin
3dfeca4c42
♻️ simplified store_instruction using closure 2023-03-25 15:43:33 +01:00
François Autin
651e03a446
📝 :refactor: Form and documentation updates 2023-03-25 15:37:14 +01:00
François Autin
7ed53261a0
📝 Documentation updates 2023-03-24 19:02:50 +01:00
François Autin
4e90d9fef7
♻️ Now all machine methods are called through self 2023-03-24 18:48:07 +01:00
François Autin
a2d5b22774
♻️ Machine::write_memory is now indeed a self method 2023-03-24 18:36:02 +01:00
François Autin
b33c31ef38
♻️ Machine::read_memory is now indeed a self method 2023-03-24 18:34:06 +01:00
François Autin
88e1921b3c
♻️ Further simplified tests 2023-03-24 18:27:28 +01:00
François Autin
7bdde70989
♻️ Removed tons of casts to usize 2023-03-24 18:20:59 +01:00
François Autin
35fdb1e0b0
📝 ♻️ Doc updates & Registers are now sized from consts 2023-03-24 18:13:18 +01:00
François Autin
928628c305
📝 Documentation updates 2023-03-24 18:11:37 +01:00
François Autin
228d58655a
🐛 Fixed missing check for position 0 2023-03-24 17:56:37 +01:00
François Autin
03cc8e17c6
♻️ Simplified imports and moved Register struct to own file 2023-03-24 17:44:24 +01:00
François Autin
c74c99499e
♻️ Removed loads of casts to usize 2023-03-24 17:32:04 +01:00
François Autin
bee0e8ce71
📝 Documentation updates for machine.rs 2023-03-23 21:55:46 +01:00
François Autin
cc6aab7c3f
Documented ExceptionType 2023-03-23 20:58:10 +01:00
François Autin
21159d3d98
Renamed exceptions to follow CamlCase convention 2023-03-23 20:54:05 +01:00
François Autin
43de76bd72
♻️ Started work on machine.rs refactoring
# Current changes

 - Crude error management
 - Readability improvements
 - Broke down one_instruction into smaller, more manageable methods
 - Added crude documentation
2023-03-23 20:05:46 +01:00
François Autin
87d90c394f
Added MachineError struct 2023-03-23 20:04:21 +01:00
François Autin
c6ea3a0cb3
♻️ Refacted machine tests with macros 2023-03-23 17:42:36 +01:00
5963759141 Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-22 18:31:05 +01:00
6d0477153b First iteration (not complete) of a test in thread_manager 2023-03-22 18:30:31 +01:00
François Autin
1118f1fa0f
Added doc to thread manager 2023-03-22 17:17:53 +01:00
François Autin
6edb88f337
Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-22 16:22:28 +01:00
François Autin
df7c0af62b
Form changes 2023-03-22 16:21:15 +01:00
Samy Solhi
21a0da8f24 Removed unwraps in synch.rs 2023-03-22 16:20:53 +01:00
François Autin
caddc445b8
Updated docs 2023-03-22 16:03:36 +01:00
ca9f458a7e Add test module to tm 2023-03-22 15:52:48 +01:00
1b44949842 remove machine from system 2023-03-22 15:48:29 +01:00
da37e0657c Merge branch 'thread_rework' into thread_scheduler 2023-03-22 15:08:38 +01:00
Samy Solhi
9ade363ca9 Merge branch 'thread_rework' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_rework 2023-03-22 15:00:27 +01:00
Samy Solhi
9d19f0630b Fix Semaphore and Lock tests 2023-03-22 14:59:28 +01:00
b104bcc6da Fix memory leak 2023-03-22 14:33:56 +01:00
b9c329219a Added 2 tests to list.rs, improve semantic and using Default trait instant of function new 2023-03-21 22:40:49 +01:00
d3b2d0bac6 List is now a fifo list 2023-03-21 22:03:48 +01:00
977cb2bf96 kernel now build
I commented out semaphore code too cause it need to be updated
and having some error cause the compiler to not check for borrow errors
2023-03-16 14:52:53 +01:00
fa64d4314d decrease some dependencies 2023-03-15 17:57:53 +01:00
Samy Solhi
6dd0cbcc87 Shadow the hedgehog 2023-03-15 16:51:57 +01:00
Samy Solhi
b22b1dea21 update synch.rs 2023-03-15 16:28:29 +01:00
amaury
f6ec9ff60f oups sorry les boys 2023-03-15 15:48:58 +01:00
amaury
b011f75e50 remove an ignore test 2023-03-15 15:45:53 +01:00
amaury
8577076f14 added the unsigned_addition test and memory mock 2023-03-15 15:35:28 +01:00
François Autin
1906ec836c
Moved to reference passing system 2023-03-15 15:20:20 +01:00
Baptiste
897903344b remove println in test 2023-03-15 15:14:45 +01:00
Baptiste
2533883ea7 machine tests ok 2023-03-15 15:12:47 +01:00
François Autin
abb97d17d5
Removed Rc<RefCell<Machine>> 2023-03-15 14:56:05 +01:00
Baptiste
84d8bcc84f div 8 2023-03-15 14:04:25 +01:00
Moysan Gabriel
539b3f6802 mmu_(read/write)_mem impl 2023-03-15 12:17:37 +01:00
9c3501eb40 Merge branch 'thread_scheduler' of https://gitlab.istic.univ-rennes1.fr/simpleos/burritos into thread_scheduler 2023-03-15 11:09:41 +01:00
c8df1e5053 use of system in parameters in synch 2023-03-15 11:09:34 +01:00
François Autin
b379305631 🎨 Exported get_new_thread macro out of thread mod 2023-03-15 11:05:01 +01:00
François Autin
bed763cf54 📝 Updated mod doc for list and system 2023-03-15 11:01:25 +01:00
François Autin
e5242aab0c Ignored machine tests for now 2023-03-15 10:53:22 +01:00
François Autin
0047b7d762 Fixed incorrect length and address readouts because of an incorrectly configured radix 2023-03-15 10:45:02 +01:00
François Autin
2a3d8f3550 Exported macro init_system 2023-03-15 10:10:53 +01:00
Moysan Gabriel
77f28d029d impl translate 2023-03-15 00:32:58 +01:00
Moysan Gabriel
ea309ab124 taille de la memoire recalculée 2023-03-14 22:55:48 +01:00
88a0b31300 Add thread_finish 2023-03-14 22:01:52 +01:00
Samy Solhi
aef8b18966 Added tests for semaphore and lock 2023-03-14 20:28:57 +01:00
Rémi Rativel
cc6ec2f94c Corrected a line added by the IDE 2023-03-14 16:46:48 +01:00
Rémi Rativel
ba895e3587 Small fix with not matching types 2023-03-14 16:44:10 +01:00
Rémi Rativel
5b8abd2a07 Merge remote-tracking branch 'origin/thread_scheduler' into thread_scheduler 2023-03-14 16:34:53 +01:00
Rémi Rativel
287a608adf Implemented constructors for synch structs 2023-03-14 16:34:44 +01:00
François Autin
4ee0c11c56
A few documentation updates 2023-03-14 15:16:40 +01:00
François Autin
81f3ac2099
Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-14 14:50:02 +01:00
François Autin
d1935e9399
Fully documented mem_cmp.rs 2023-03-14 14:49:58 +01:00
François Autin
03ac599c7f
Removed lifetime tag from Semaphore implementation 2023-03-14 14:49:45 +01:00
Rémi Rativel
df1b7a59e4 Merge remote-tracking branch 'origin/thread_scheduler' into thread_scheduler 2023-03-14 14:45:26 +01:00
Rémi Rativel
d70de26f02 Structure documentation 2023-03-14 14:45:19 +01:00
François Autin
eeb0e336c7 what the fuck was that 2023-03-14 00:33:53 +01:00
Rémi Rativel
08f684ccce Merge remote-tracking branch 'origin/thread_scheduler' into thread_scheduler 2023-03-14 00:09:54 +01:00
Rémi Rativel
d4333a672a fixed some issues made in last merge 2023-03-14 00:09:45 +01:00
François Autin
9318871c31 Fixed tests from mem_cmp 2023-03-13 23:55:35 +01:00
Rémi Rativel
65ac9c6f06 merging 2023-03-13 23:45:09 +01:00
Rémi Rativel
dc6c454250 Merge remote-tracking branch 'origin/thread_scheduler' into thread_scheduler
# Conflicts:
#	src/kernel/synch.rs
2023-03-13 23:41:20 +01:00
Rémi Rativel
5b7a12ab0f Documentation for different functions of synch.rs 2023-03-13 23:38:45 +01:00
Moysan Gabriel
3391d3cb65 impl translation table + debut impl mmu 2023-03-13 22:52:27 +01:00
7de7f2e007 Fix scheduler switch_to by making a lot of change(use smart pointers in place of lifetime reference) 2023-03-13 21:47:06 +01:00
39e26e61bb Add thread_sleep 2023-03-13 20:55:46 +01:00
amaury
c0765270d7 ajout de fichiers mémoire et des registre en cours d'execution 2023-03-13 19:00:54 +01:00
Moysan Gabriel
be19031c32 enum visibility 2023-03-13 18:01:02 +01:00
Moysan Gabriel
5f798edb94 enum d'erreurs dans machine, du code pour gerer les erreurs dans le futur 2023-03-13 17:49:48 +01:00
Moysan Gabriel
172dad6598 mmu & translation table def 2023-03-13 17:42:03 +01:00
François Autin
5b4683c736
Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-13 15:09:50 +01:00
François Autin
0e57576b6a
Added single unit test necessary for system 2023-03-13 15:09:46 +01:00
5a6a70f1b7 Force the compiler and clippy to return a warning when a function isn't documented 2023-03-13 14:51:32 +01:00
François Autin
c75e2995e7
Reworked unit tests for machine and renamed test_programs directory 2023-03-12 00:22:16 +01:00
François Autin
177abfe846
Renamed Machine::init_machine and fixed stack overflow by allocating main_memory to the heap 2023-03-11 23:49:20 +01:00
1f54ed35db Implement thread#t_yield() 2023-03-11 14:48:56 +01:00
François Autin
e1283c9c42
Fixed missing crate import 2023-03-10 19:17:41 +01:00
François Autin
61c9300c6a
Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-10 19:14:03 +01:00
45fea708fc
Changed all reference to thread with an RefCell to enforce mutability 2023-03-10 19:11:16 +01:00
François Autin
a1713e0373
added comments to macros 2023-03-10 19:11:16 +01:00
François Autin
9a86520a77
Put default thread name in a const 2023-03-10 19:11:15 +01:00
François Autin
6e6b97911a
Added debug attributes to structs pertaining to thread in order to allow for applying assertions upon Thread 2023-03-10 19:11:15 +01:00
François Autin
71ccd0c16e
Added macro to get new thread easily and started writing test 2023-03-10 19:11:15 +01:00
François Autin
eeac26aba6
Changed constructor to allow any string slice as parameter + started writing unit tests 2023-03-10 19:11:15 +01:00
26b75ffe8d
Add thread save and restore processor context 2023-03-10 19:11:13 +01:00
0c3af96b78
Fix start_thread 2023-03-10 19:04:23 +01:00
6820086579
Added thread manager 2023-03-10 19:04:23 +01:00
Samy Solhi
1ac2e322cf
synch.rs implemented 2023-03-10 19:04:23 +01:00
3406544e3b
Remove old static vars in scheduler, doesn't work 2023-03-10 19:04:23 +01:00
75e5c17f28
Fix thread 2023-03-10 19:04:23 +01:00
François Autin
ec07158633
Added partialeq trait to Node 2023-03-10 19:04:23 +01:00
François Autin
95e0ac4499
Added partialeq trait where relevant 2023-03-10 19:04:22 +01:00
Rémi Rativel
aad2ecbd4c
small fix 2023-03-10 19:04:22 +01:00
Rémi Rativel
5465267f3c
Sarting synch.rs implementation 2023-03-10 19:04:22 +01:00
bf4be44676
Add list.remove(T) 2023-03-10 19:04:22 +01:00
François Autin
6b95969c4b
Added partialeq trait to List struct 2023-03-10 19:04:22 +01:00
François Autin
b59fb83e60
Main now initializes System object 2023-03-10 19:04:21 +01:00
François Autin
a459a31210
Added System initializer method 2023-03-10 19:03:51 +01:00
Moysan Gabriel
6e6fbb5e1d
dataTypes definition 2023-03-10 19:03:51 +01:00
François Autin
e763712880
New system structure 2023-03-10 19:03:51 +01:00
François Autin
69e1a3e444
Fixed ucontext & libc 2023-03-10 19:03:51 +01:00
dc49951bab
Implemente finish (not finished yet), fix ucontext for windows 2023-03-10 19:03:49 +01:00
3457f67a7c
Add ucontext_t 2023-03-10 19:02:38 +01:00
e4db7ec96b
Implement interrupt 2023-03-10 19:02:37 +01:00
621b0568b0
Move system to the right location 2023-03-10 19:01:22 +01:00
83df053dc6
Implement Thread::start and join 2023-03-10 19:01:22 +01:00
c140830faa
Adding some content to thread 2023-03-10 19:01:22 +01:00
99fc514720
Change var name to fit with rust conventions 2023-03-10 19:01:22 +01:00
cf1c7aad5a
Fix global var 2023-03-10 19:01:22 +01:00
e3e217c57f
scheduler done 2023-03-10 19:01:22 +01:00
adce79aaa8
Add scheduler structure 2023-03-10 19:01:21 +01:00
336ccd1425
Add thread structure 2023-03-10 19:01:21 +01:00
958407ab77
Improve list by adding iterator trait 2023-03-10 19:01:21 +01:00
407480bcd4
Add double linked list 2023-03-10 19:01:21 +01:00
a38251c111
Add kernel mod 2023-03-10 19:01:20 +01:00
François Autin
6ee74ba126
Fixed more clippy complaining 2023-03-10 11:03:54 +01:00
François Autin
be8435cf83
Cleaned clippy lint warnings from machine.rs 2023-03-10 10:59:14 +01:00
François Autin
44e3f586e2
Fixed some clippy complaining 2023-03-10 10:38:58 +01:00
François Autin
6db52669b4
Removed useless variable 2023-03-10 10:34:13 +01:00
François Autin
5155b62b06
Added proper error handling to extract_memory_method 2023-03-10 10:32:20 +01:00
François Autin
3971fb0630
Merge branch 'thread_scheduler' of gitlab.istic.univ-rennes1.fr:simpleos/burritos into thread_scheduler 2023-03-09 14:03:39 +01:00
François Autin
ecff299b28
added comments to macros 2023-03-09 14:03:35 +01:00
e1ba3f6078 Changed all reference to thread with an RefCell to enforce mutability 2023-03-09 14:00:42 +01:00
François Autin
f586c56a0b
Put default thread name in a const 2023-03-09 13:33:00 +01:00
François Autin
bfef7254d8
Added debug attributes to structs pertaining to thread in order to allow for applying assertions upon Thread 2023-03-09 13:24:04 +01:00
François Autin
8bf7a452f3
Added macro to get new thread easily and started writing test 2023-03-09 13:07:50 +01:00
François Autin
0f339dd936
Changed constructor to allow any string slice as parameter + started writing unit tests 2023-03-09 12:44:03 +01:00
d392c69535 Add thread save and restore processor context 2023-03-09 12:08:33 +01:00