Removed build-iso target.

That won't be needed. Since this is more of a kernel project rather than
an operating system, it shouldn't need to be booted from an ISO. Later I
may create a proper OS using GNU userland.
This commit is contained in:
Nicolás Ortega Froysa 2018-03-18 15:22:19 +01:00
parent 5ae9ea5e7e
commit 114d2d515c
No known key found for this signature in database
GPG Key ID: FEC70E3BAE2E69BF
3 changed files with 19 additions and 21 deletions

View File

@ -14,10 +14,11 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 3.3)
project(colonel C ASM) project(colonel C ASM)
set(TARGET_NAME "colonel.bin") set(TARGET_NAME "colonel.bin")
set(TARGET_VERSION "0.1")
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "release") set(CMAKE_BUILD_TYPE "release")
@ -53,13 +54,14 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
"src/kernel/arch/x86/") "src/kernel/arch/x86/")
endif() endif()
add_executable(${TARGET_NAME} ${SRCS}) # version pre-processor definition
add_compile_options($<$<COMPILE_LANGUAGE:C>:-DVERSION="${TARGET_VERSION}">)
add_custom_target(build-iso # allow debug info to be printed if necessary
COMMAND mkdir -p isodir/boot/grub/ if(${CMAKE_BUILD_TYPE} STREQUAL "debug")
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/configs/grub.cfg isodir/boot/grub/ add_compile_options($<$<COMPILE_LANGUAGE:C>:-DDEBUG>)
COMMAND cp ${TARGET_NAME} isodir/boot/ else()
COMMAND grub-mkrescue -o colonel.iso isodir add_compile_options($<$<COMPILE_LANGUAGE:C>:-DNDEBUG>)
DEPENDS ${TARGET_NAME} endif()
COMMENT "Building ISO iamge..."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/configs/grub.cfg) add_executable(${TARGET_NAME} ${SRCS})

15
README
View File

@ -25,18 +25,17 @@ architecture. You can find the available toolchains for building in the
make make
This should create a release build of the project. If you would like debug This should create a release build of the project. If you would like debug
flags then add the `-DCMAKE_BUILD_TYPE=debug' option to the `cmake' command. If flags then add the `-DCMAKE_BUILD_TYPE=debug' option to the `cmake' command.
you would like to build an ISO file then run the `build-iso' make target.
# Testing # Testing
--------- ---------
The safest environment to test this in would be an emulator. The one I use is The safest environment to test this in would be an emulator. The one I use is
QEMU (https://www.qemu.org/). You can run the ISO image directly under QEMU, QEMU (https://www.qemu.org/). You can run the kernel directly (i.e.
and the kernel itself (i.e. `colonel.bin') can be run by using the `-kernel' `colonel.bin') by using the `-kernel' option. If you'd like to debug the kernel
option. If you'd like to debug the kernel using QEMU and GDB you can do so by using QEMU and GDB you can do so by running `qemu -S -s -kernel colonel.bin'.,
running `qemu -S -s -kernel colonel.bin', which will open a server on localhost which will open a server on `localhost' allowing you to connect with GDB for
allowing you to connect with GDB for debugging. At this point you can connect debugging. At this point you can connect to the server and load the symbols by
to the server and load the symbols by running the following in the GDB prompt: running the following in the GDB prompt:
(gdb) target remote localhost:1234 (gdb) target remote localhost:1234
(gdb) symbol-file colonel.bin (gdb) symbol-file colonel.bin

View File

@ -1,3 +0,0 @@
menuentry "ColonelOS" {
multiboot /boot/colonel.bin
}