2020-05-06 15:40:06 +00:00
|
|
|
set(KERNEL_SOURCES
|
|
|
|
ACPI/DMIDecoder.cpp
|
|
|
|
ACPI/DynamicParser.cpp
|
|
|
|
ACPI/Initialize.cpp
|
|
|
|
ACPI/MultiProcessorParser.cpp
|
|
|
|
ACPI/Parser.cpp
|
|
|
|
Arch/i386/CPU.cpp
|
|
|
|
CMOS.cpp
|
|
|
|
CommandLine.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Console.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Devices/BXVGADevice.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Devices/BlockDevice.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Devices/CharacterDevice.cpp
|
|
|
|
Devices/Device.cpp
|
|
|
|
Devices/DiskPartition.cpp
|
|
|
|
Devices/EBRPartitionTable.cpp
|
|
|
|
Devices/FullDevice.cpp
|
|
|
|
Devices/GPTPartitionTable.cpp
|
|
|
|
Devices/KeyboardDevice.cpp
|
|
|
|
Devices/MBRPartitionTable.cpp
|
|
|
|
Devices/MBVGADevice.cpp
|
|
|
|
Devices/NullDevice.cpp
|
|
|
|
Devices/PATAChannel.cpp
|
|
|
|
Devices/PATADiskDevice.cpp
|
|
|
|
Devices/PCSpeaker.cpp
|
|
|
|
Devices/PS2MouseDevice.cpp
|
|
|
|
Devices/RandomDevice.cpp
|
|
|
|
Devices/SB16.cpp
|
|
|
|
Devices/SerialDevice.cpp
|
|
|
|
Devices/VMWareBackdoor.cpp
|
|
|
|
Devices/ZeroDevice.cpp
|
|
|
|
DoubleBuffer.cpp
|
|
|
|
FileSystem/Custody.cpp
|
|
|
|
FileSystem/DevPtsFS.cpp
|
|
|
|
FileSystem/Ext2FileSystem.cpp
|
|
|
|
FileSystem/FIFO.cpp
|
|
|
|
FileSystem/File.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
FileSystem/FileBackedFileSystem.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
FileSystem/FileDescription.cpp
|
|
|
|
FileSystem/FileSystem.cpp
|
|
|
|
FileSystem/Inode.cpp
|
|
|
|
FileSystem/InodeFile.cpp
|
|
|
|
FileSystem/InodeWatcher.cpp
|
|
|
|
FileSystem/ProcFS.cpp
|
|
|
|
FileSystem/TmpFS.cpp
|
|
|
|
FileSystem/VirtualFileSystem.cpp
|
|
|
|
Heap/SlabAllocator.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Heap/kmalloc.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Interrupts/APIC.cpp
|
|
|
|
Interrupts/GenericInterruptHandler.cpp
|
|
|
|
Interrupts/IOAPIC.cpp
|
|
|
|
Interrupts/IRQHandler.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Interrupts/InterruptManagement.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Interrupts/PIC.cpp
|
|
|
|
Interrupts/SharedIRQHandler.cpp
|
|
|
|
Interrupts/SpuriousInterruptHandler.cpp
|
|
|
|
Interrupts/UnhandledInterruptHandler.cpp
|
|
|
|
KBufferBuilder.cpp
|
|
|
|
KSyms.cpp
|
|
|
|
Lock.cpp
|
|
|
|
Net/E1000NetworkAdapter.cpp
|
|
|
|
Net/IPv4Socket.cpp
|
|
|
|
Net/LocalSocket.cpp
|
|
|
|
Net/LoopbackAdapter.cpp
|
|
|
|
Net/NetworkAdapter.cpp
|
|
|
|
Net/NetworkTask.cpp
|
|
|
|
Net/RTL8139NetworkAdapter.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Net/Routing.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Net/Socket.cpp
|
|
|
|
Net/TCPSocket.cpp
|
|
|
|
Net/UDPSocket.cpp
|
|
|
|
PCI/Access.cpp
|
|
|
|
PCI/Device.cpp
|
|
|
|
PCI/IOAccess.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
PCI/Initializer.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
PCI/MMIOAccess.cpp
|
|
|
|
PerformanceEventBuffer.cpp
|
|
|
|
Process.cpp
|
|
|
|
Profiling.cpp
|
|
|
|
Ptrace.cpp
|
|
|
|
RTC.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Random.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Scheduler.cpp
|
|
|
|
SharedBuffer.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
StdLib.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Syscall.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
TTY/MasterPTY.cpp
|
|
|
|
TTY/PTYMultiplexer.cpp
|
|
|
|
TTY/SlavePTY.cpp
|
|
|
|
TTY/TTY.cpp
|
|
|
|
TTY/VirtualConsole.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Tasks/FinalizerTask.cpp
|
|
|
|
Tasks/SyncTask.cpp
|
|
|
|
Thread.cpp
|
|
|
|
ThreadTracer.cpp
|
|
|
|
Time/HPET.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Time/HPETComparator.cpp
|
|
|
|
Time/HardwareTimer.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Time/PIT.cpp
|
|
|
|
Time/RTC.cpp
|
|
|
|
Time/TimeManagement.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
TimerQueue.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
VM/AnonymousVMObject.cpp
|
|
|
|
VM/ContiguousVMObject.cpp
|
|
|
|
VM/InodeVMObject.cpp
|
|
|
|
VM/MemoryManager.cpp
|
|
|
|
VM/PageDirectory.cpp
|
|
|
|
VM/PhysicalPage.cpp
|
|
|
|
VM/PhysicalRegion.cpp
|
|
|
|
VM/PrivateInodeVMObject.cpp
|
|
|
|
VM/ProcessPagingScope.cpp
|
|
|
|
VM/PurgeableVMObject.cpp
|
|
|
|
VM/RangeAllocator.cpp
|
|
|
|
VM/Region.cpp
|
|
|
|
VM/SharedInodeVMObject.cpp
|
|
|
|
VM/VMObject.cpp
|
|
|
|
WaitQueue.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
init.cpp
|
|
|
|
kprintf.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(AK_SOURCES
|
|
|
|
../AK/FileSystemPath.cpp
|
|
|
|
../AK/FlyString.cpp
|
|
|
|
../AK/JsonParser.cpp
|
|
|
|
../AK/JsonValue.cpp
|
|
|
|
../AK/LogStream.cpp
|
|
|
|
../AK/String.cpp
|
|
|
|
../AK/StringBuilder.cpp
|
|
|
|
../AK/StringImpl.cpp
|
|
|
|
../AK/StringUtils.cpp
|
|
|
|
../AK/StringView.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ELF_SOURCES
|
|
|
|
../Libraries/LibELF/Image.cpp
|
|
|
|
../Libraries/LibELF/Loader.cpp
|
|
|
|
../Libraries/LibELF/Validation.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
${KERNEL_SOURCES}
|
|
|
|
${AK_SOURCES}
|
|
|
|
${ELF_SOURCES}
|
|
|
|
)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DKERNEL")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -ffreestanding -fbuiltin")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
|
|
|
|
|
|
|
|
add_link_options(LINKER:-T ${CMAKE_CURRENT_BINARY_DIR}/linker.ld -nostdlib)
|
|
|
|
|
|
|
|
add_library(boot OBJECT Arch/i386/Boot/boot.S)
|
|
|
|
file(GENERATE OUTPUT linker.ld INPUT linker.ld)
|
|
|
|
|
|
|
|
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
|
2020-05-16 04:52:49 +00:00
|
|
|
include_directories(/usr/local/include/c++/10.1.0/)
|
|
|
|
include_directories(/usr/local/include/c++/10.1.0/i686-pc-serenity/)
|
2020-05-06 15:40:06 +00:00
|
|
|
else()
|
2020-05-16 04:52:49 +00:00
|
|
|
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/)
|
|
|
|
include_directories(../Toolchain/Local/i686-pc-serenity/include/c++/10.1.0/i686-pc-serenity/)
|
2020-05-06 15:40:06 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(Kernel ${SOURCES})
|
2020-05-20 12:23:34 +00:00
|
|
|
target_link_libraries(Kernel gcc stdc++)
|
2020-05-06 15:40:06 +00:00
|
|
|
add_dependencies(Kernel boot)
|
|
|
|
install(TARGETS Kernel RUNTIME DESTINATION boot)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
TARGET Kernel
|
|
|
|
COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh
|
|
|
|
)
|
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kernel.map DESTINATION res)
|
|
|
|
|
|
|
|
add_subdirectory(Modules)
|