aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md40
-rw-r--r--src/kernel/graphics/vesa.c6
-rw-r--r--src/kernel/paging/kheap.c6
3 files changed, 30 insertions, 22 deletions
diff --git a/README.md b/README.md
index b962360..ea0b03c 100644
--- a/README.md
+++ b/README.md
@@ -2,26 +2,36 @@
<p align="center">
<i>„A lightweight unix-like operating system“</i>
<br><br>
- <img src="https://img.shields.io/travis/marvinborner/Melvix?style=for-the-badge" />
+ <a href="https://travis-ci.com/marvinborner/Melvix" target="_blank">
+ <img src="https://img.shields.io/travis/marvinborner/Melvix?style=for-the-badge" />
+ </a>
+ <a href="https://app.codacy.com/manual/marvin-borner/Melvix/dashboard" target="_blank">
+ <img src="https://img.shields.io/codacy/grade/4ae29e218d7c439eaa549ea828ffcaac?style=for-the-badge" />
+ </a>
</p>
## Build
* Use any system running GNU/Linux (Successfully tried building on Debian, Arch Linux and even OpenBSD)
+
* Install build dependencies (package names may vary depending on your operating system)
- * binutils
- * gcc
- * make
- * bison
- * flex
- * gmp
- * mpc
- * mpfr
- * texinfo
- * curl
- * nasm
- * grub
- * qemu
+ * binutils
+ * gcc
+ * make
+ * bison
+ * flex
+ * gmp
+ * mpc
+ * mpfr
+ * texinfo
+ * curl
+ * nasm
+ * grub
+ * qemu
+
* Build a cross compiler using `make cross`
-* Run `make build`
+
+* Run `make build`
+
* Test Melvix in QEMU (opens after `make test`)
+
* Optional: Flash the built ISO to a USB/Floppy/CD drive using `sudo dd if=./build/melvix.iso of=/dev/sdX bs=4M oflag=sync`
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 03c189f..cc9dd97 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -67,10 +67,8 @@ struct vbe_mode_info *vbe_set_mode(unsigned short mode) {
return vbe_info;
} else {
switch_to_vga();
+ return ((void *) 0);
}
-
- struct vbe_mode_info vbe_info;
- return &vbe_info;
}
void set_optimal_resolution() {
@@ -83,7 +81,7 @@ void set_optimal_resolution() {
regs16_t regs;
regs.ax = 0x4F00;
regs.es = 0;
- regs.di = info;
+ regs.di = (unsigned short) info;
int32(0x10, &regs);
if (regs.ax != 0x004F || strcmp(info->signature, "VESA") != 0) {
diff --git a/src/kernel/paging/kheap.c b/src/kernel/paging/kheap.c
index 94aa547..e4f3d20 100644
--- a/src/kernel/paging/kheap.c
+++ b/src/kernel/paging/kheap.c
@@ -55,7 +55,7 @@ uint32_t kmalloc(uint32_t sz) {
static void expand(uint32_t new_size, heap_t *heap) {
assert(new_size > heap->end_address - heap->start_address);
- if (new_size & 0xFFFFF000 != 0) {
+ if ((new_size & 0xFFFFF000) != 0) {
new_size &= 0xFFFFF000;
new_size += 0x1000;
}
@@ -100,7 +100,7 @@ static int find_smallest_hole(uint32_t size, unsigned char page_align, heap_t *h
if (page_align > 0) {
uint32_t location = (uint32_t) header;
int offset = 0;
- if ((location + sizeof(header_t)) & 0xFFFFF000 != 0)
+ if (((location + sizeof(header_t)) & 0xFFFFF000) != 0)
offset = 0x1000 - (location + sizeof(header_t)) % 0x1000;
int hole_size = (int) header->size - offset;
@@ -128,7 +128,7 @@ heap_t *create_heap(uint32_t start, uint32_t end_addr, uint32_t max, unsigned ch
heap->index = place_ordered_array((void *) start, HEAP_INDEX_SIZE, &header_t_less_than);
start += sizeof(type_t) * HEAP_INDEX_SIZE;
- if (start & 0xFFFFF000 != 0) {
+ if ((start & 0xFFFFF000) != 0) {
start &= 0xFFFFF000;
start += 0x1000;
}