Add back x86_32 support #5

Merged
Bananymous merged 46 commits from x86_32 into main 2024-04-02 23:36:29 +00: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-02 23:35:46 +00:00
It will be easier to just rewrite them
This allows keeping size of TmpInodeInfo as 128
I will be dropping lai entirely soon. Once I get to writing AML
interpreter.
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.
This makes more sense if we support i386
This allows mask to be atomic on 32 bit architectures
This allows signal mask to be atomic on 32 bit target
I don't really want to be working with i386 since it doesn't support
compare exchange instruction
Boot assembly now initializes processor and jumps to kernel
The code is pretty much the same, so there are just couple macros
differiating initialization.
Having 32 bit address space does not mean physical address space
is also only 32 bits...
This is mostly copied from x86_64 with necessary modifications
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.
This is needed on i686 to set segment registers.
This allows accessing (garbage) sp and ss in interrupt stack.
This actually allows i686 to boot properly!
Also remove unnecessary ds clearing in x86_64.
Bananymous merged commit 731330c6b5 into main 2024-04-02 23:36:29 +00:00
Bananymous deleted branch x86_32 2024-04-02 23:36:29 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Bananymous/banan-os#5