mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Support i386
This commit is contained in:
parent
38dae2c9f7
commit
9e21c5326b
12
.vscode/c_cpp_properties.json
vendored
12
.vscode/c_cpp_properties.json
vendored
@ -37,10 +37,10 @@
|
||||
"-Wpointer-arith",
|
||||
"-Wcast-align",
|
||||
"-Wredundant-decls",
|
||||
"-Winit-self",
|
||||
"-Winit-self",
|
||||
"-Wswitch-default",
|
||||
"-Wstrict-overflow=5",
|
||||
"-Wconversion",
|
||||
"-Wconversion",
|
||||
|
||||
// C++ flags
|
||||
"-fno-rtti",
|
||||
@ -84,7 +84,7 @@
|
||||
"a32",
|
||||
"DEBUG=\"1\""
|
||||
],
|
||||
"compilerPath": "${workspaceFolder}/../tools/cross/bin/i686-elf-gcc",
|
||||
"compilerPath": "${workspaceFolder}/../tools/cross/bin/i386-elf-gcc",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++20",
|
||||
"intelliSenseMode": "gcc-x86",
|
||||
@ -109,17 +109,17 @@
|
||||
"-Wpointer-arith",
|
||||
"-Wcast-align",
|
||||
"-Wredundant-decls",
|
||||
"-Winit-self",
|
||||
"-Winit-self",
|
||||
"-Wswitch-default",
|
||||
"-Wstrict-overflow=5",
|
||||
"-Wconversion",
|
||||
"-Wconversion",
|
||||
|
||||
// C++ flags
|
||||
"-fno-rtti",
|
||||
"-fexceptions",
|
||||
|
||||
// Linker flags
|
||||
"-T${workspaceFolder}/Architecture/i686/linker.ld",
|
||||
"-T${workspaceFolder}/Architecture/i386/linker.ld",
|
||||
"-Wl,-static,--no-dynamic-linker,-ztext",
|
||||
"-nostdlib",
|
||||
"-nodefaultlibs",
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include "../../Architecture/amd64/cpu/gdt.hpp"
|
||||
#include "../Architecture/amd64/cpu/apic.hpp"
|
||||
#elif defined(a32)
|
||||
#include "../../Architecture/i686/cpu/gdt.hpp"
|
||||
#include "../Architecture/i686/cpu/apic.hpp"
|
||||
#include "../../Architecture/i386/cpu/gdt.hpp"
|
||||
#include "../Architecture/i386/cpu/apic.hpp"
|
||||
#elif defined(aa64)
|
||||
#endif
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include "../Architecture/amd64/acpi.hpp"
|
||||
#include "../Architecture/amd64/cpu/apic.hpp"
|
||||
#elif defined(a32)
|
||||
#include "../Architecture/i686/cpu/gdt.hpp"
|
||||
#include "../Architecture/i686/cpu/idt.hpp"
|
||||
#include "../Architecture/i386/cpu/gdt.hpp"
|
||||
#include "../Architecture/i386/cpu/idt.hpp"
|
||||
#elif defined(aa64)
|
||||
#endif
|
||||
|
||||
|
2
DAPI.hpp
2
DAPI.hpp
@ -372,7 +372,7 @@ union CPURegisters
|
||||
unsigned long rflags;
|
||||
unsigned long rsp;
|
||||
unsigned long ss;
|
||||
#elif defined(__i386__) || defined(__i686__)
|
||||
#elif defined(__i386__)
|
||||
unsigned int ebp;
|
||||
unsigned int edi;
|
||||
unsigned int esi;
|
||||
|
2
Fex.hpp
2
Fex.hpp
@ -74,7 +74,7 @@ struct FexExtended
|
||||
char Name[64];
|
||||
enum FexDriverType Type : 4;
|
||||
enum FexDriverInputTypes TypeFlags : 4;
|
||||
bool OverrideOnConflict : 1;
|
||||
char OverrideOnConflict : 1;
|
||||
int (*Callback)(union KernelCallback *);
|
||||
int (*InterruptCallback)(union CPURegisters *);
|
||||
|
||||
|
34
Makefile
34
Makefile
@ -22,23 +22,23 @@ GIT_COMMIT_SHORT = $(shell git rev-parse --short HEAD)
|
||||
BMP_SOURCES = $(shell find ./ -type f -name '*.bmp')
|
||||
PSF_SOURCES = $(shell find ./ -type f -name '*.psf')
|
||||
ifeq ($(OSARCH), amd64)
|
||||
ASM_SOURCES = $(shell find ./ -type f -name '*.asm' -not -path "./Architecture/i686/*" -not -path "./Architecture/aarch64/*")
|
||||
S_SOURCES = $(shell find ./ -type f -name '*.S' -not -path "./Architecture/i686/*" -not -path "./Architecture/aarch64/*")
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/i686/*" -not -path "./Architecture/aarch64/*")
|
||||
CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/i686/*" -not -path "./Architecture/aarch64/*")
|
||||
RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/i686/*" -not -path "./Architecture/aarch64/*")
|
||||
else ifeq ($(OSARCH), i686)
|
||||
ASM_SOURCES = $(shell find ./ -type f -name '*.asm' -not -path "./Architecture/i386/*" -not -path "./Architecture/aarch64/*")
|
||||
S_SOURCES = $(shell find ./ -type f -name '*.S' -not -path "./Architecture/i386/*" -not -path "./Architecture/aarch64/*")
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/i386/*" -not -path "./Architecture/aarch64/*")
|
||||
CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/i386/*" -not -path "./Architecture/aarch64/*")
|
||||
RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/i386/*" -not -path "./Architecture/aarch64/*")
|
||||
else ifeq ($(OSARCH), i386)
|
||||
ASM_SOURCES = $(shell find ./ -type f -name '*.asm' -not -path "./Architecture/amd64/*" -not -path "./Architecture/aarch64/*")
|
||||
S_SOURCES = $(shell find ./ -type f -name '*.S' -not -path "./Architecture/amd64/*" -not -path "./Architecture/aarch64/*")
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/amd64/*" -not -path "./Architecture/aarch64/*")
|
||||
CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/amd64/*" -not -path "./Architecture/aarch64/*")
|
||||
RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/amd64/*" -not -path "./Architecture/aarch64/*")
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
ASM_SOURCES = $(shell find ./ -type f -name '*.asm' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i686/*")
|
||||
S_SOURCES = $(shell find ./ -type f -name '*.S' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i686/*")
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i686/*")
|
||||
CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i686/*")
|
||||
RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i686/*")
|
||||
ASM_SOURCES = $(shell find ./ -type f -name '*.asm' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*")
|
||||
S_SOURCES = $(shell find ./ -type f -name '*.S' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*")
|
||||
C_SOURCES = $(shell find ./ -type f -name '*.c' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*")
|
||||
CPP_SOURCES = $(shell find ./ -type f -name '*.cpp' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*")
|
||||
RS_SOURCES = $(shell find ./ -type f -name '*.rs' -not -path "./Architecture/amd64/*" -not -path "./Architecture/i386/*")
|
||||
endif
|
||||
HEADERS = $(sort $(dir $(wildcard ./include/*)))
|
||||
OBJ = $(C_SOURCES:.c=.o) $(CPP_SOURCES:.cpp=.o) $(RS_SOURCES:.rs=.o) $(ASM_SOURCES:.asm=.o) $(S_SOURCES:.S=.o) $(PSF_SOURCES:.psf=.o) $(BMP_SOURCES:.bmp=.o)
|
||||
@ -77,13 +77,13 @@ LDFLAGS += -TArchitecture/amd64/linker.ld \
|
||||
-zmax-page-size=0x1000 \
|
||||
-Wl,-Map kernel.map -shared
|
||||
|
||||
else ifeq ($(OSARCH), i686)
|
||||
else ifeq ($(OSARCH), i386)
|
||||
|
||||
CFLAGS += -fno-pic -fno-pie -mno-80387 -mno-mmx -mno-3dnow \
|
||||
-mno-red-zone -march=pentium -pipe -msoft-float \
|
||||
-fno-builtin -Da32
|
||||
CFLAG_STACK_PROTECTOR := -fstack-protector-all
|
||||
LDFLAGS += -TArchitecture/i686/linker.ld \
|
||||
LDFLAGS += -TArchitecture/i386/linker.ld \
|
||||
-fno-pic -fno-pie \
|
||||
-Wl,-static,--no-dynamic-linker,-ztext \
|
||||
-nostdlib -nodefaultlibs -nolibc \
|
||||
@ -100,7 +100,7 @@ endif
|
||||
|
||||
ifeq ($(OSARCH), amd64)
|
||||
NASMFLAGS := -f elf64
|
||||
else ifeq ($(OSARCH), i686)
|
||||
else ifeq ($(OSARCH), i386)
|
||||
NASMFLAGS := -f elf32
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
NASMFLAGS :=
|
||||
@ -162,7 +162,7 @@ $(KERNEL_FILENAME): $(OBJ)
|
||||
$(info Compiling $<)
|
||||
ifeq ($(OSARCH), amd64)
|
||||
$(AS) -c $< -o $@
|
||||
else ifeq ($(OSARCH), i686)
|
||||
else ifeq ($(OSARCH), i386)
|
||||
$(AS) -c $< -o $@
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
$(AS) -c $< -o $@
|
||||
@ -171,7 +171,7 @@ endif
|
||||
%.o: %.psf
|
||||
ifeq ($(OSARCH), amd64)
|
||||
$(OBJCOPY) -O elf64-x86-64 -I binary $< $@
|
||||
else ifeq ($(OSARCH), i686)
|
||||
else ifeq ($(OSARCH), i386)
|
||||
$(OBJCOPY) -O elf32-i386 -I binary $< $@
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
$(OBJCOPY) -O elf64-littleaarch64 -I binary $< $@
|
||||
@ -181,7 +181,7 @@ endif
|
||||
%.o: %.bmp
|
||||
ifeq ($(OSARCH), amd64)
|
||||
$(OBJCOPY) -O elf64-x86-64 -I binary $< $@
|
||||
else ifeq ($(OSARCH), i686)
|
||||
else ifeq ($(OSARCH), i386)
|
||||
$(OBJCOPY) -O elf32-i386 -I binary $< $@
|
||||
else ifeq ($(OSARCH), aarch64)
|
||||
$(OBJCOPY) -O elf64-littlearch64 -I binary $< $@
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "../Architecture/amd64/cpu/apic.hpp"
|
||||
#include "../Architecture/amd64/cpu/gdt.hpp"
|
||||
#elif defined(a32)
|
||||
#include "../Architecture/i686/cpu/apic.hpp"
|
||||
#include "../Architecture/i386/cpu/apic.hpp"
|
||||
#elif defined(aa64)
|
||||
#endif
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "../Architecture/amd64/cpu/apic.hpp"
|
||||
#include "../Architecture/amd64/cpu/gdt.hpp"
|
||||
#elif defined(a32)
|
||||
#include "../Architecture/i686/cpu/apic.hpp"
|
||||
#include "../Architecture/i386/cpu/apic.hpp"
|
||||
#elif defined(aa64)
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user