2020-08-10 15:44:35 +00:00
|
|
|
set(KERNEL_HEAP_SOURCES
|
|
|
|
Heap/SlabAllocator.cpp
|
|
|
|
Heap/kmalloc.cpp
|
|
|
|
)
|
|
|
|
|
2020-10-17 11:39:36 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_STATIC}")
|
|
|
|
|
2020-05-06 15:40:06 +00:00
|
|
|
set(KERNEL_SOURCES
|
|
|
|
ACPI/DynamicParser.cpp
|
|
|
|
ACPI/Initialize.cpp
|
|
|
|
ACPI/MultiProcessorParser.cpp
|
|
|
|
ACPI/Parser.cpp
|
|
|
|
Arch/i386/CPU.cpp
|
2020-06-27 23:06:33 +00:00
|
|
|
Arch/i386/ProcessorInfo.cpp
|
2020-05-22 10:55:23 +00:00
|
|
|
Arch/PC/BIOS.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
CMOS.cpp
|
|
|
|
CommandLine.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Console.cpp
|
2020-11-06 08:09:51 +00:00
|
|
|
CoreDump.cpp
|
2020-11-02 18:16:01 +00:00
|
|
|
Devices/AsyncDeviceRequest.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
|
2021-01-01 10:20:55 +00:00
|
|
|
Devices/Device.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Devices/FullDevice.cpp
|
2020-11-07 19:09:28 +00:00
|
|
|
Devices/I8042Controller.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Devices/KeyboardDevice.cpp
|
|
|
|
Devices/MBVGADevice.cpp
|
|
|
|
Devices/NullDevice.cpp
|
|
|
|
Devices/PCSpeaker.cpp
|
|
|
|
Devices/PS2MouseDevice.cpp
|
|
|
|
Devices/RandomDevice.cpp
|
|
|
|
Devices/SB16.cpp
|
|
|
|
Devices/SerialDevice.cpp
|
2020-09-04 07:59:38 +00:00
|
|
|
Devices/UHCIController.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Devices/VMWareBackdoor.cpp
|
|
|
|
Devices/ZeroDevice.cpp
|
2020-12-25 18:23:35 +00:00
|
|
|
Storage/Partition/DiskPartition.cpp
|
2020-12-25 20:48:29 +00:00
|
|
|
Storage/Partition/DiskPartitionMetadata.cpp
|
2020-12-25 18:23:35 +00:00
|
|
|
Storage/Partition/EBRPartitionTable.cpp
|
2020-12-26 14:53:30 +00:00
|
|
|
Storage/Partition/GUIDPartitionTable.cpp
|
2020-12-25 18:23:35 +00:00
|
|
|
Storage/Partition/MBRPartitionTable.cpp
|
2020-12-26 14:53:30 +00:00
|
|
|
Storage/Partition/PartitionTable.cpp
|
2020-12-19 10:50:57 +00:00
|
|
|
Storage/StorageDevice.cpp
|
|
|
|
Storage/IDEController.cpp
|
|
|
|
Storage/IDEChannel.cpp
|
|
|
|
Storage/PATADiskDevice.cpp
|
2020-12-19 13:25:06 +00:00
|
|
|
Storage/StorageManagement.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
DoubleBuffer.cpp
|
2020-07-02 09:48:08 +00:00
|
|
|
FileSystem/BlockBasedFileSystem.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
FileSystem/Custody.cpp
|
2020-12-25 17:26:38 +00:00
|
|
|
FileSystem/DevFS.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
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
|
2020-07-02 10:05:56 +00:00
|
|
|
FileSystem/Plan9FileSystem.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
FileSystem/ProcFS.cpp
|
|
|
|
FileSystem/TmpFS.cpp
|
|
|
|
FileSystem/VirtualFileSystem.cpp
|
|
|
|
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
|
2020-12-18 08:52:52 +00:00
|
|
|
PCI/DeviceController.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
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
|
2020-08-15 19:13:19 +00:00
|
|
|
ProcessGroup.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
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-07-30 21:38:15 +00:00
|
|
|
Syscalls/access.cpp
|
|
|
|
Syscalls/alarm.cpp
|
|
|
|
Syscalls/beep.cpp
|
|
|
|
Syscalls/chdir.cpp
|
|
|
|
Syscalls/chmod.cpp
|
|
|
|
Syscalls/chown.cpp
|
|
|
|
Syscalls/chroot.cpp
|
|
|
|
Syscalls/clock.cpp
|
|
|
|
Syscalls/debug.cpp
|
2020-08-04 11:51:11 +00:00
|
|
|
Syscalls/disown.cpp
|
2020-08-15 08:54:00 +00:00
|
|
|
Syscalls/dup2.cpp
|
2020-07-30 21:38:15 +00:00
|
|
|
Syscalls/execve.cpp
|
|
|
|
Syscalls/exit.cpp
|
|
|
|
Syscalls/fcntl.cpp
|
|
|
|
Syscalls/fork.cpp
|
|
|
|
Syscalls/ftruncate.cpp
|
|
|
|
Syscalls/futex.cpp
|
|
|
|
Syscalls/get_dir_entries.cpp
|
|
|
|
Syscalls/get_stack_bounds.cpp
|
|
|
|
Syscalls/getrandom.cpp
|
|
|
|
Syscalls/getuid.cpp
|
|
|
|
Syscalls/hostname.cpp
|
|
|
|
Syscalls/ioctl.cpp
|
|
|
|
Syscalls/kill.cpp
|
|
|
|
Syscalls/link.cpp
|
|
|
|
Syscalls/lseek.cpp
|
|
|
|
Syscalls/mkdir.cpp
|
|
|
|
Syscalls/mknod.cpp
|
|
|
|
Syscalls/mmap.cpp
|
|
|
|
Syscalls/module.cpp
|
|
|
|
Syscalls/mount.cpp
|
|
|
|
Syscalls/open.cpp
|
|
|
|
Syscalls/perf_event.cpp
|
|
|
|
Syscalls/pipe.cpp
|
|
|
|
Syscalls/pledge.cpp
|
2020-12-25 17:27:42 +00:00
|
|
|
Syscalls/prctl.cpp
|
2020-07-30 21:38:15 +00:00
|
|
|
Syscalls/process.cpp
|
|
|
|
Syscalls/profiling.cpp
|
|
|
|
Syscalls/ptrace.cpp
|
|
|
|
Syscalls/purge.cpp
|
|
|
|
Syscalls/read.cpp
|
|
|
|
Syscalls/readlink.cpp
|
|
|
|
Syscalls/realpath.cpp
|
|
|
|
Syscalls/rename.cpp
|
|
|
|
Syscalls/rmdir.cpp
|
|
|
|
Syscalls/sched.cpp
|
|
|
|
Syscalls/select.cpp
|
|
|
|
Syscalls/sendfd.cpp
|
|
|
|
Syscalls/setkeymap.cpp
|
|
|
|
Syscalls/setpgid.cpp
|
|
|
|
Syscalls/setuid.cpp
|
|
|
|
Syscalls/shbuf.cpp
|
|
|
|
Syscalls/shutdown.cpp
|
|
|
|
Syscalls/sigaction.cpp
|
|
|
|
Syscalls/socket.cpp
|
|
|
|
Syscalls/stat.cpp
|
|
|
|
Syscalls/sync.cpp
|
|
|
|
Syscalls/sysconf.cpp
|
|
|
|
Syscalls/thread.cpp
|
|
|
|
Syscalls/times.cpp
|
|
|
|
Syscalls/ttyname.cpp
|
|
|
|
Syscalls/umask.cpp
|
|
|
|
Syscalls/uname.cpp
|
|
|
|
Syscalls/unlink.cpp
|
|
|
|
Syscalls/unveil.cpp
|
|
|
|
Syscalls/utime.cpp
|
|
|
|
Syscalls/waitid.cpp
|
|
|
|
Syscalls/watch_file.cpp
|
|
|
|
Syscalls/write.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
|
2020-11-29 23:05:27 +00:00
|
|
|
ThreadBlockers.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
ThreadTracer.cpp
|
2020-10-25 15:13:47 +00:00
|
|
|
Time/APICTimer.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
Time/HPET.cpp
|
2020-05-16 10:00:04 +00:00
|
|
|
Time/HPETComparator.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-09-12 03:11:07 +00:00
|
|
|
UserOrKernelBuffer.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
|
2020-09-05 21:52:14 +00:00
|
|
|
VM/PurgeablePageRanges.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
VM/RangeAllocator.cpp
|
|
|
|
VM/Region.cpp
|
|
|
|
VM/SharedInodeVMObject.cpp
|
|
|
|
VM/VMObject.cpp
|
2020-12-25 11:51:11 +00:00
|
|
|
VirtualAddress.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
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
|
2020-12-31 11:17:03 +00:00
|
|
|
../AK/ByteBuffer.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
../AK/FlyString.cpp
|
2020-08-09 09:34:26 +00:00
|
|
|
../AK/GenericLexer.cpp
|
2020-12-31 11:17:03 +00:00
|
|
|
../AK/Hex.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
../AK/JsonParser.cpp
|
|
|
|
../AK/JsonValue.cpp
|
2020-05-26 11:52:44 +00:00
|
|
|
../AK/LexicalPath.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
../AK/LogStream.cpp
|
|
|
|
../AK/String.cpp
|
|
|
|
../AK/StringBuilder.cpp
|
|
|
|
../AK/StringImpl.cpp
|
|
|
|
../AK/StringUtils.cpp
|
|
|
|
../AK/StringView.cpp
|
2020-08-25 23:19:16 +00:00
|
|
|
../AK/Time.cpp
|
2020-09-22 11:05:40 +00:00
|
|
|
../AK/Format.cpp
|
2020-12-31 11:17:03 +00:00
|
|
|
../AK/UUID.cpp
|
2020-05-06 15:40:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(ELF_SOURCES
|
|
|
|
../Libraries/LibELF/Image.cpp
|
|
|
|
../Libraries/LibELF/Validation.cpp
|
|
|
|
)
|
|
|
|
|
2020-05-26 21:35:14 +00:00
|
|
|
set(VT_SOURCES
|
|
|
|
../Libraries/LibVT/Terminal.cpp
|
|
|
|
../Libraries/LibVT/Line.cpp
|
|
|
|
)
|
|
|
|
|
2020-06-10 08:22:31 +00:00
|
|
|
set(KEYBOARD_SOURCES
|
|
|
|
../Libraries/LibKeyboard/CharacterMap.cpp
|
|
|
|
)
|
|
|
|
|
2020-06-23 02:23:35 +00:00
|
|
|
set(CRYPTO_SOURCES
|
|
|
|
../Libraries/LibCrypto/Cipher/AES.cpp
|
|
|
|
../Libraries/LibCrypto/Hash/SHA2.cpp
|
|
|
|
)
|
|
|
|
|
2020-09-27 10:44:03 +00:00
|
|
|
set(C_SOURCES
|
|
|
|
../Libraries/LibC/ctype.cpp
|
|
|
|
)
|
|
|
|
|
2020-05-06 15:40:06 +00:00
|
|
|
set(SOURCES
|
|
|
|
${KERNEL_SOURCES}
|
|
|
|
${AK_SOURCES}
|
|
|
|
${ELF_SOURCES}
|
2020-05-26 21:35:14 +00:00
|
|
|
${VT_SOURCES}
|
2020-06-10 08:22:31 +00:00
|
|
|
${KEYBOARD_SOURCES}
|
2020-06-23 02:23:35 +00:00
|
|
|
${CRYPTO_SOURCES}
|
2020-09-27 10:44:03 +00:00
|
|
|
${C_SOURCES}
|
2020-05-06 15:40:06 +00:00
|
|
|
)
|
|
|
|
|
2020-09-01 09:59:55 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -DKERNEL")
|
2021-01-01 13:12:20 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
|
2020-05-06 15:40:06 +00:00
|
|
|
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")
|
2021-01-02 11:02:42 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
2020-05-06 15:40:06 +00:00
|
|
|
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)
|
2020-08-10 15:44:35 +00:00
|
|
|
add_library(kernel_heap STATIC ${KERNEL_HEAP_SOURCES})
|
2020-05-06 15:40:06 +00:00
|
|
|
file(GENERATE OUTPUT linker.ld INPUT linker.ld)
|
|
|
|
|
|
|
|
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
|
2020-10-12 09:38:50 +00:00
|
|
|
include_directories(/usr/local/include/c++/10.2.0/)
|
2020-12-29 03:38:52 +00:00
|
|
|
include_directories(/usr/local/include/c++/10.2.0/${SERENITY_ARCH}-pc-serenity/)
|
2020-05-06 15:40:06 +00:00
|
|
|
else()
|
2020-12-29 03:38:52 +00:00
|
|
|
include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.2.0/)
|
|
|
|
include_directories(../Toolchain/Local/${SERENITY_ARCH}/${SERENITY_ARCH}-pc-serenity/include/c++/10.2.0/${SERENITY_ARCH}-pc-serenity/)
|
2020-05-06 15:40:06 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(Kernel ${SOURCES})
|
2020-08-10 15:44:35 +00:00
|
|
|
target_link_libraries(Kernel kernel_heap gcc stdc++)
|
|
|
|
add_dependencies(Kernel boot kernel_heap)
|
2020-05-06 15:40:06 +00:00
|
|
|
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)
|
|
|
|
|
2020-05-26 18:20:24 +00:00
|
|
|
serenity_install_headers(Kernel)
|
2020-08-15 12:11:10 +00:00
|
|
|
serenity_install_sources(Kernel)
|
2020-05-26 18:20:24 +00:00
|
|
|
|
2020-05-06 15:40:06 +00:00
|
|
|
add_subdirectory(Modules)
|