Confirmed uppermem in multiboot structure is being read correctly. Changed kernel versioning to be more in line with the Semantic Versioning Specification

This commit is contained in:
2019-02-09 21:37:42 -06:00
parent 4ba0f93efc
commit a587fd6fe2
4 changed files with 16 additions and 11 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
#ifndef BUILD_NUMBER
#define BUILD_NUMBER "111"
#define BUILD_NUMBER "117"
#endif
#ifndef VERSION_STR
#define VERSION_STR "0.0.2.111 - Sat Feb 9 17:10:29 CST 2019"
#define VERSION_STR "0.0.2+117 - Sat Feb 9 21:35:00 CST 2019"
#endif
#ifndef VERSION_STR_SHORT
#define VERSION_STR_SHORT "0.0.2.111"
#define VERSION_STR_SHORT "0.0.2+117"
#endif
+1 -1
View File
@@ -1,7 +1,7 @@
#!sh
# FILE: make_buildnum.sh
#version="`sed 's/^ *//' major_version`"
version="0.0.2."
version="0.0.2+"
old="`sed 's/^ *//' build.number`"
old=$(($old + 1))
echo $old > build.number
+2 -2
View File
@@ -18,7 +18,7 @@ objects = obj/start.o \
obj/port.o
run:kernel.iso
qemu-system-x86_64 -m 64M -cdrom kernel.iso &
qemu-system-x86_64 -m 256M -cdrom kernel.iso &
obj/%.o: src/%.c
mkdir -p $(@D)
@@ -53,4 +53,4 @@ clean:
.PHONY: resetbuild
resetbuild:
echo 0 > build.number
echo 0 > build.number
+10 -5
View File
@@ -124,10 +124,12 @@ void outportb (unsigned short _port, unsigned char _data)
extern void main(uint32_t multiboot_magic, const void* multiboot_structure)
{
/* You would add commands after here */
init_video();
if(multiboot_magic == 0x2BADB002)
{
/*
https://www.gnu.org/software/grub/manual/multiboot/multiboot.html
*/
puts("Multiboot 1 compliant bootloader detected.\n");
uint32_t* bootloaderName = (uint32_t*)(((size_t)multiboot_structure) + 64);
puts("Bootloader Name: ");
@@ -136,6 +138,9 @@ extern void main(uint32_t multiboot_magic, const void* multiboot_structure)
}
else if (multiboot_magic == 0x36d76289)
{
/*
https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html
*/
puts("Multiboot 2 compliant bootloader detected.\n");
}
else
@@ -143,6 +148,7 @@ extern void main(uint32_t multiboot_magic, const void* multiboot_structure)
puts("Unkown bootloader magic number detected:");
puts(int_to_string(multiboot_magic, 16));
puts("\n");
//panic();
}
puts("Bootloader structure appears to be have been loaded at memory address: 0x");
puts(int_to_string(multiboot_structure, 16));
@@ -151,13 +157,12 @@ extern void main(uint32_t multiboot_magic, const void* multiboot_structure)
puts("Framebuffer address: ");
puts(int_to_string((*videoBuffer), 16));
puts("\n");
uint32_t* totalMem = (uint32_t*)(((size_t)multiboot_structure) + 8);
puts(int_to_string((*totalMem), 10));
puts(" kilobytes of RAM installed on the system\n");
puts("Video initialized.\n");
gdt_install();
puts("Global Descriptor Table initialized.\n");
//uint32_t* memupper = (uint32_t*)(((size_t)multiboot_structure) + 8);
//puts(int_to_string(memupper, 16));
//size_t heap = 10 * 1024 * 1024;
//MemoryManager(heap, (*memupper)*1024 - heap - 10*1024); //second needs to be an address not size
//puts("heap: 0x");