Add back x86_32 support #5

Merged
Bananymous merged 46 commits from x86_32 into main 2024-04-03 02:36:29 +03:00
Owner

32 bit has not been supported in a long time but it is now back and working. There are still some panics that don't exist in x86_64 probably partially since the whole scheduler was rewritten. Threads now use processor specific stack and forced interrupt while rescheduling. This fixes the old hacky context saving which depended on compiler stack usage and code generation. This approach did not work for 32 bit which uses stack more heavily.

32 bit has not been supported in a long time but it is now back and working. There are still some panics that don't exist in x86_64 probably partially since the whole scheduler was rewritten. Threads now use processor specific stack and forced interrupt while rescheduling. This fixes the old hacky context saving which depended on compiler stack usage and code generation. This approach did not work for 32 bit which uses stack more heavily.
Bananymous added 46 commits 2024-04-03 02:35:46 +03:00
26ed689d30 Kernel: Remove old GDT, IDT and MMU code from i386
It will be easier to just rewrite them
2352c86048 Kernel: i386 has 14 indirect blocks in TmpInode instead of 2
This allows keeping size of TmpInodeInfo as 128
0424082e7b Kernel: Only compile lai for x86_64 targets
I will be dropping lai entirely soon. Once I get to writing AML
interpreter.
7f029b2713 Kernel: Allow Processor compilation for i386 targets
This is achieved by rewriting some inline assembly and changing
ProcessorID to be 32 bit value. For some reason if processor id
is 8 bits gcc runs out of 8 bit registers on i386.
fe17958b9f Kernel: Rename rsp->sp and rip->ip
This makes more sense if we support i386
a9db4dd9a3 Kernel: NVMe Queue max simultaneous commands is dependent on arch
This allows mask to be atomic on 32 bit architectures
93975fdc45 Kernel: Process signal mask is now 2 32 bit values
This allows signal mask to be atomic on 32 bit target
99e30a4d7d Kernel: Replace i386 with i686
I don't really want to be working with i386 since it doesn't support
compare exchange instruction
af050cc729 Kernel: Fix boot code for x86_32
Boot assembly now initializes processor and jumps to kernel
1943c3e7a1 Kernel: Unify IDT and GDT code between x86_64 and x86_32
The code is pretty much the same, so there are just couple macros
differiating initialization.
4d1f0e77f2 Kernel: Fix physical address size for x86_32
Having 32 bit address space does not mean physical address space
is also only 32 bits...
c12d1e9bd9 Kernel: Implement PageTable for x86_32
This is mostly copied from x86_64 with necessary modifications
5050047cef Kernel: Rewrite whole scheduler
Current context saving was very hacky and dependant on compiler
behaviour that was not consistent. Now we always use iret for
context saving. This makes everything more clean.
fe386fa819 Kernel: Implement thread start trampoline for userspace
This is needed on i686 to set segment registers.
9e073e9fa0 Kernel: Add offset for interrupt stack in Scheduler::yield()
This allows accessing (garbage) sp and ss in interrupt stack.
0dd74e3c9d Kernel: Implement syscalls for i686 and cleanup x86_64
This actually allows i686 to boot properly!
d2df55b1ac Kernel: Allow booting with multiple processors on i686
Also remove unnecessary ds clearing in x86_64.
Bananymous merged commit 731330c6b5 into main 2024-04-03 02:36:29 +03:00
Bananymous deleted branch x86_32 2024-04-03 02:36:29 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bananymous/banan-os#5
No description provided.