From c97ed2abb6f06f59a296ea5f522663db5752dba5 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Wed, 3 Apr 2019 14:15:15 +0200 Subject: [PATCH 01/21] Small stuff --- Readme.md | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 Readme.md diff --git a/Readme.md b/Readme.md deleted file mode 100644 index 915c162..0000000 --- a/Readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# OS/K (OS on Kaleid) - -| ![FSF Logo](https://www.os-k.eu/GPLLOGO.PNG) | This program is free software, released under the terms of the [GNU GPL](COPYING) version 3 or later as published by the Free Software Foundation | -|----------------------------------------------|----------------------------------------------------------------------| - -### Fully free operating system from scratch (WIP) - -For the project plan, see [OS/K Project](https://github.com/orgs/os-k-team/projects/1) - -For changelog, see [ChangeLog](ChangeLog) - -For structure of the sources, see [ProjectTree](ProjectTree) - -Note that every file within OS/K is written using spaces for tabulation, with each -tabulation being 4 spaces long. - -#### Compile from sources - -To compile this project from sources, you must first install the dependencies - -``` -apt update && apt upgrade -apt install grub-pc dosfstools make nasm qemu -``` - -You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) in `/opt/cross-cc`. - -To compile, simply use at the root of this project : -``` -make -``` - -To compile and test, simply use at the root of this project : -``` -make test -``` From f99c758c0cce6dd551487984438b6b910da27e0b Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Wed, 3 Apr 2019 14:16:04 +0200 Subject: [PATCH 02/21] Small stuff --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..915c162 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# OS/K (OS on Kaleid) + +| ![FSF Logo](https://www.os-k.eu/GPLLOGO.PNG) | This program is free software, released under the terms of the [GNU GPL](COPYING) version 3 or later as published by the Free Software Foundation | +|----------------------------------------------|----------------------------------------------------------------------| + +### Fully free operating system from scratch (WIP) + +For the project plan, see [OS/K Project](https://github.com/orgs/os-k-team/projects/1) + +For changelog, see [ChangeLog](ChangeLog) + +For structure of the sources, see [ProjectTree](ProjectTree) + +Note that every file within OS/K is written using spaces for tabulation, with each +tabulation being 4 spaces long. + +#### Compile from sources + +To compile this project from sources, you must first install the dependencies + +``` +apt update && apt upgrade +apt install grub-pc dosfstools make nasm qemu +``` + +You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) in `/opt/cross-cc`. + +To compile, simply use at the root of this project : +``` +make +``` + +To compile and test, simply use at the root of this project : +``` +make test +``` From 0bdad29198f48779793098bdb1731bcaeae478c9 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Wed, 3 Apr 2019 14:33:43 +0200 Subject: [PATCH 03/21] stylehlp stuff --- .stylehlp | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ .stylehlp_asm | 23 ----------------- .stylehlp_c | 23 ----------------- 3 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 .stylehlp delete mode 100644 .stylehlp_asm delete mode 100644 .stylehlp_c diff --git a/.stylehlp b/.stylehlp new file mode 100644 index 0000000..0a8b519 --- /dev/null +++ b/.stylehlp @@ -0,0 +1,71 @@ +//----------------------------------------------------------------------------// +// GNU GPL OS/K // +// // +// Desc: // +// // +// // +// Copyright © 2018-2019 The OS/K Team // +// // +// This file is part of OS/K. // +// // +// OS/K is free software: you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation, either version 3 of the License, or // +// any later version. // +// // +// OS/K is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY//without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with OS/K. If not, see . // +//----------------------------------------------------------------------------// + +;=----------------------------------------------------------------------------=; +; GNU GPL OS/K ; +; ; +; Desc: ; +; ; +; ; +; Copyright © 2018-2019 The OS/K Team ; +; ; +; This file is part of OS/K. ; +; ; +; OS/K is free software: you can redistribute it and/or modify ; +; it under the terms of the GNU General Public License as published by ; +; the Free Software Foundation, either version 3 of the License, or ; +; (at your option) any later version. ; +; ; +; OS/K is distributed in the hope that it will be useful, ; +; but WITHOUT ANY WARRANTY; without even the implied warranty of ; +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; +; GNU General Public License for more details. ; +; ; +; You should have received a copy of the GNU General Public License ; +; along with OS/K. If not, see . ; +;=----------------------------------------------------------------------------=; + +#=----------------------------------------------------------------------------=# +# GNU GPL OS/K # +# # +# Desc: # +# # +# # +# Copyright © 2018-2019 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# diff --git a/.stylehlp_asm b/.stylehlp_asm deleted file mode 100644 index 2916a2e..0000000 --- a/.stylehlp_asm +++ /dev/null @@ -1,23 +0,0 @@ -;=----------------------------------------------------------------------------=; -; GNU GPL OS/K ; -; ; -; Desc: ; -; ; -; ; -; Copyright © 2018-2019 The OS/K Team ; -; ; -; This file is part of OS/K. ; -; ; -; OS/K is free software: you can redistribute it and/or modify ; -; it under the terms of the GNU General Public License as published by ; -; the Free Software Foundation, either version 3 of the License, or ; -; (at your option) any later version. ; -; ; -; OS/K is distributed in the hope that it will be useful, ; -; but WITHOUT ANY WARRANTY; without even the implied warranty of ; -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; -; GNU General Public License for more details. ; -; ; -; You should have received a copy of the GNU General Public License ; -; along with OS/K. If not, see . ; -;=----------------------------------------------------------------------------=; diff --git a/.stylehlp_c b/.stylehlp_c deleted file mode 100644 index 3340c00..0000000 --- a/.stylehlp_c +++ /dev/null @@ -1,23 +0,0 @@ -//----------------------------------------------------------------------------// -// GNU GPL OS/K // -// // -// Desc: // -// // -// // -// Copyright © 2018-2019 The OS/K Team // -// // -// This file is part of OS/K. // -// // -// OS/K is free software: you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation, either version 3 of the License, or // -// any later version. // -// // -// OS/K is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY//without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with OS/K. If not, see . // -//----------------------------------------------------------------------------// From 887aa60973bddfc29ba582c8810774bba8f97497 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Thu, 4 Apr 2019 18:41:39 +0200 Subject: [PATCH 04/21] Non-locking I/O for panic() --- kaleid/kernel/buf/bprint.c | 24 ++++++++++++++++++------ kaleid/kernel/init/init.c | 12 ++++++------ kaleid/kernel/io/vga.c | 4 +--- kaleid/kernel/ke/panic.c | 20 +++++++++++++++----- 4 files changed, 40 insertions(+), 20 deletions(-) diff --git a/kaleid/kernel/buf/bprint.c b/kaleid/kernel/buf/bprint.c index a75ee22..1c49fd3 100644 --- a/kaleid/kernel/buf/bprint.c +++ b/kaleid/kernel/buf/bprint.c @@ -25,6 +25,7 @@ #include extern error_t bputc(Buffer_t *buf, uchar ch); +error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap); // // Prints formatted string on buf according to fmt @@ -35,11 +36,25 @@ error_t BPrintOnBuf(Buffer_t *buf, const char *fmt, ...) va_list ap; va_start(ap, fmt); - rc = BPrintOnBufV(buf, fmt, ap); + ExAcquireLock(&buf->lock); + rc = vbprintf(buf, fmt, ap); + ExReleaseLock(&buf->lock); va_end(ap); return rc; } + +error_t BPrintOnBufV(Buffer_t *buf, const char *fmt, va_list ap) +{ + error_t rc; + + ExAcquireLock(&buf->lock); + rc = vbprintf(buf, fmt, ap); + ExReleaseLock(&buf->lock); + + return rc; +} + // // Prints 0 for octal, 0x for hexadecimal, 0b for binary // @@ -81,10 +96,10 @@ static error_t bdopadding(Buffer_t *buf, size_t width, size_t len, #define fmtnext() do{fmt++;if(*fmt==0){rc=EINVAL;goto leave;}}while(0) // -// Actually does BPrintOnBuf's job +// Actually does BPrintOnBuf's job; doesn't lock anything // Quite a long function // -error_t BPrintOnBufV(Buffer_t *buf, const char *fmt, va_list ap) +error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) { error_t rc = EOK; int tmpwidth; @@ -120,8 +135,6 @@ error_t BPrintOnBufV(Buffer_t *buf, const char *fmt, va_list ap) return EBADF; } - ExAcquireLock(&buf->lock); - //----------------------------------------------------------------------------// // We come back here after dealing with a modifier @@ -367,7 +380,6 @@ loop: //----------------------------------------------------------------------------// leave: - ExReleaseLock(&buf->lock); return rc; } diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 2e63b1a..7121469 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -147,18 +147,18 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) // Sanity checks and hello world BtInitSanity(mbMagic); - //Memory mapping + // Memory mapping MmInitMemoryMap(); + // Heap initialization MmInitHeap(); - //int i = 0; - //while(i < 512) { KernLog("%d\n", i++);} - //MmPrintMemoryMap(); - PsInitSched(); // We're out PsFiniSched(); - KeCrashSystem(); //yay + + KeStartPanic("Test Panic %d", 4); + + KeCrashSystem(); } diff --git a/kaleid/kernel/io/vga.c b/kaleid/kernel/io/vga.c index 6956df9..0230143 100644 --- a/kaleid/kernel/io/vga.c +++ b/kaleid/kernel/io/vga.c @@ -44,9 +44,7 @@ error_t bvgaflusher(Buffer_t *buf) ushort *fbp = BtGetBootInfo(video).framebufferAddr; const uchar color = 0xf; - assert(buf->lastLF == 0); - - uchar *currentLine = buf->wp - buf->lineLen; + uchar *currentLine = buf->wp - buf->lineLen - buf->lastLF; uchar *ptr = (uchar *)lmax((size_t)buf->buf, (size_t)currentLine - (buf->nLines - 1) * buf->lineLen); diff --git a/kaleid/kernel/ke/panic.c b/kaleid/kernel/ke/panic.c index 52555f3..c6cbb5a 100644 --- a/kaleid/kernel/ke/panic.c +++ b/kaleid/kernel/ke/panic.c @@ -28,6 +28,8 @@ #include #include +error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap); + // // Failed assert() handler // @@ -55,21 +57,29 @@ noreturn void KeStartPanic(const char *fmt, ...) PsCurProc = NULL; if (BStdOut == NULL) KeCrashSystem(); + ExAttemptLock(&BStdOut->lock); + if (fmt == NULL) { fmt = "(no message given)"; } if (KePanicStr[0] != 0) { - KernLog("\nDouble panic!"); + vbprintf(BStdOut, "\nDouble panic!", NULL); KeHaltCPU(); } + + KePanicStr[0] = 1; + // We don't check vbprintf's output + // If it fails, what could we do anyway? + + vbprintf(BStdOut, "\nPanic!\n\n", NULL); + va_start(ap, fmt); - vsnprintf((char *)KePanicStr, PANICSTR_SIZE, fmt, ap); + vbprintf(BStdOut, fmt, ap); va_end(ap); - - KernLog("\nPanic!\n\n"); - KernLog((char *)KePanicStr); + + BStdOut->flusher(BStdOut); KeHaltCPU(); } From a35203b8763218067c27af824b53568dd62aeeac Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Thu, 4 Apr 2019 18:42:09 +0200 Subject: [PATCH 05/21] Non-locking I/O for panic() --- kaleid/kernel/ke/panic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kaleid/kernel/ke/panic.c b/kaleid/kernel/ke/panic.c index c6cbb5a..7e153a5 100644 --- a/kaleid/kernel/ke/panic.c +++ b/kaleid/kernel/ke/panic.c @@ -22,7 +22,6 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include #include #include #include From b009b6b3c6837f57d61b4cede27283cb6c41b281 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Thu, 4 Apr 2019 18:47:30 +0200 Subject: [PATCH 06/21] Cleanup and IRC channel --- README.md | 5 ++++- kaleid/kernel/init/init.c | 11 +++-------- kaleid/kernel/proc/Makefile | 9 --------- kaleid/kernel/proc/sched.c | 2 +- 4 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 kaleid/kernel/proc/Makefile diff --git a/README.md b/README.md index 915c162..5c486a0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ For changelog, see [ChangeLog](ChangeLog) For structure of the sources, see [ProjectTree](ProjectTree) Note that every file within OS/K is written using spaces for tabulation, with each -tabulation being 4 spaces long. +tabulation being 4 spaces long. + +IRC Channel: #os.k-devel on Freenode #### Compile from sources @@ -34,3 +36,4 @@ To compile and test, simply use at the root of this project : ``` make test ``` + diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 7121469..d0b2eea 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -141,24 +141,19 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) // Initialize the BootInfo_t structure BtInitBootInfo(mbInfo); - // Get ready to print things + // Screen I/O available from this point on IoInitVGABuffer(); // Sanity checks and hello world BtInitSanity(mbMagic); - // Memory mapping + // Memory & scheduler MmInitMemoryMap(); - - // Heap initialization MmInitHeap(); - PsInitSched(); - // We're out - PsFiniSched(); - KeStartPanic("Test Panic %d", 4); + // End this machine's suffering KeCrashSystem(); } diff --git a/kaleid/kernel/proc/Makefile b/kaleid/kernel/proc/Makefile deleted file mode 100644 index 7fe9eea..0000000 --- a/kaleid/kernel/proc/Makefile +++ /dev/null @@ -1,9 +0,0 @@ - -sched-test: - gcc -O0 -Wall -Wextra -I../../include -c ../init/table.c -o table.o - gcc -O2 -Wall -Wextra -I../../include -c ./sched.c -o sched.o - gcc sched.o table.o -o a.out - rm sched.o table.o - -clean: - rm a.out diff --git a/kaleid/kernel/proc/sched.c b/kaleid/kernel/proc/sched.c index 75e448f..09794bc 100644 --- a/kaleid/kernel/proc/sched.c +++ b/kaleid/kernel/proc/sched.c @@ -324,7 +324,7 @@ void PsInitSched(void) } // -// Shutdown scheduler +// Shutdowns scheduler // void PsFiniSched(void) { From cd662168471538c13f1f9abc5491c783328886e1 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Thu, 4 Apr 2019 20:17:50 +0200 Subject: [PATCH 07/21] Made a much better vbprintf() --- Makefile | 2 +- README.md | 2 +- kaleid/kernel/buf/bprint.c | 449 ++++++++++++++--------------- kaleid/kernel/{proc => ps}/sched.c | 0 4 files changed, 225 insertions(+), 228 deletions(-) rename kaleid/kernel/{proc => ps}/sched.c (100%) diff --git a/Makefile b/Makefile index b3653f9..e8d5967 100644 --- a/Makefile +++ b/Makefile @@ -178,7 +178,7 @@ $(KOBJDIR)/kernel/bput.o: $(KERNELDIR)/kernel/buf/bput.c $(KERNELDIR)/include/*/ $(KOBJDIR)/kernel/bprint.o: $(KERNELDIR)/kernel/buf/bprint.c $(KERNELDIR)/include/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/sched.o: $(KERNELDIR)/kernel/proc/sched.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/sched.o: $(KERNELDIR)/kernel/ps/sched.c $(KERNELDIR)/include/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} diff --git a/README.md b/README.md index 5c486a0..e6f8557 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ apt update && apt upgrade apt install grub-pc dosfstools make nasm qemu ``` -You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) in `/opt/cross-cc`. +You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) and its "bin" repertory in your PATH. To compile, simply use at the root of this project : ``` diff --git a/kaleid/kernel/buf/bprint.c b/kaleid/kernel/buf/bprint.c index 1c49fd3..2118a5f 100644 --- a/kaleid/kernel/buf/bprint.c +++ b/kaleid/kernel/buf/bprint.c @@ -87,13 +87,7 @@ static error_t bdopadding(Buffer_t *buf, size_t width, size_t len, return rc; } -#define bdoconvrt(pref, type, vtype) do { \ - type i_##type = (type)va_arg(ap, vtype); \ - pref##toa(i_##type, s, base); \ -} while (0) - -// Increase fmt while parsing a modifier -#define fmtnext() do{fmt++;if(*fmt==0){rc=EINVAL;goto leave;}}while(0) +#define CONVBUFSIZE 100 // // Actually does BPrintOnBuf's job; doesn't lock anything @@ -101,17 +95,16 @@ static error_t bdopadding(Buffer_t *buf, size_t width, size_t len, // error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) { - error_t rc = EOK; - int tmpwidth; - size_t width; + error_t rc = 0; + + int width, prec, len; char type; uchar uch; char *s; // Conversion buffer - char convbuf[100]; - size_t len; + char convbuf[CONVBUFSIZE]; // Flags int plus, minus, space, zero, hash; @@ -135,251 +128,255 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) return EBADF; } -//----------------------------------------------------------------------------// + // Progress in format string + while (*fmt && !rc) { - // We come back here after dealing with a modifier -loop: - - // Deal with all non-'%' characters - for (; *fmt && *fmt != '%' ; fmt++) { - rc = bputc(buf, *fmt); - continue; - } - - // Job's done / something bad happened - if (rc || !*fmt) goto leave; - -//----------------------------------------------------------------------------// - - // - // %[parameter][flags][width|*][.precision][length]type - // We aren't dealing with parameters and float stuff just yet - // - - // Skip the '%' - fmtnext(); - - // "%%" modifier - if (*fmt == '%') { - rc = bputc(buf, '%'); - - if (rc > 0) goto leave; - else { + // Deal with all non-'%' characters + if (*fmt != '%') { + rc = bputc(buf, *fmt); + fmt++; - goto loop; + continue; } - } - // Reset everything - width = 0; - cap = sgn = 0; - l = h = hh = 0; - plus = minus = space = zero = hash = 0; + // + // %[parameter][flags][width|*][.precision|*][length]type + // We aren't dealing with parameters and floating stuff just yet + // -//----------------------------------------------------------------------------// + // Skip the '%' + fmt++; - // - // Flags field - // - while (1) { - if (*fmt == '#') hash++; - else if (*fmt == '0') zero++; - else if (*fmt == '+') plus++; - else if (*fmt == '-') minus++; - else if (*fmt == ' ') space++; - else break; - fmtnext(); - } + // "%%" modifier + if (*fmt == '%') { + rc = bputc(buf, '%'); + + fmt++; + continue; + } -//----------------------------------------------------------------------------// + // Reset everything + cap = sgn = 0; + l = h = hh = 0; + width = prec = 0; + plus = minus = space = zero = hash = 0; - // - // Width field - // A width field of zero is ignored - // + // + // Flags field + // + while (*fmt) { + if (*fmt == '#') { fmt++; hash++; } + else if (*fmt == '0') { fmt++; zero++; } + else if (*fmt == '+') { fmt++; plus++; } + else if (*fmt == '-') { fmt++; minus++; } + else if (*fmt == ' ') { fmt++; space++; } + + // Next field + else break; + } - // '*' means we should extract it from the argument list - if (*fmt == '*') { - fmtnext(); - tmpwidth = va_arg(ap, int); + // + // Width & precision fields + // A width field of zero is ignored + // + + // Extracts either width or precision + #define bextractwp(name) \ + do { \ + if (*fmt == '*') { \ + fmt++; \ + name = va_arg(ap, int); \ + } else { \ + while (isdigit(*fmt) && name < CONVBUFSIZE) { \ + name = 10 * name + (*fmt - '0'); \ + fmt++; \ + } \ + } \ + } while (0) + + // Extract width + bextractwp(width); // A width below 0 activates the "minus" flag - if (tmpwidth < 0) { - width = -tmpwidth; + if (width < 0) { + width = -width; minus++; - } else { - width = tmpwidth; } - } else { - // Extract width field from fmt - while (isdigit(*fmt) && width < sizeof(convbuf)-10) { - width = 10 * width + (*fmt - '0'); - fmtnext(); + + // Extract precision + if (*fmt == '.') { + fmt++; + bextractwp(prec); } - } - if (width > sizeof(convbuf)) { - rc = EINVAL; - goto leave; - } + // Make sure they're not too big + if (width > CONVBUFSIZE || prec > CONVBUFSIZE) { + rc = EINVAL; + break; + } -//----------------------------------------------------------------------------// + // + // Length field + // - // - // Precision field - // Ignored until floats are implemented - // TODO before floats: %.XXXs - // + while (*fmt) { + if (*fmt == 'l' || *fmt == 'z' || *fmt == 't') { + fmt++; + l++; + } -//----------------------------------------------------------------------------// + else if (*fmt == 'h') { + fmt++; + h++; + } + + // Next field + else break; + } - // - // Length field - // - while (1) { - if (*fmt == 'l' || *fmt == 'z') l++; - else if (*fmt == 'h') h++; - else break; - fmtnext(); - } + // Consistency check + assert(!(l > 0 && h > 0)); + assert(!(l > 2 || h > 1)); - // Consistency check - assert(!(l > 0 && h > 0)); - assert(!(l > 2 || h > 2)); + // + // The type field + // -//----------------------------------------------------------------------------// + type = *fmt++; - // - // The type field - // - type = *fmt++; + // Characters + if (type == 'c') { + uch = (uchar)va_arg(ap, int); + bputc(buf, uch); - // Characters - if (type == 'c') { - uch = (uchar)va_arg(ap, int); - bputc(buf, uch); + continue; + } - goto loop; - } + // Strings + else if (type == 's') { + s = va_arg(ap, char *); - // Strings - else if (type == 's') { - s = va_arg(ap, char *); + if (s == NULL) s = "(null)"; - if (s == NULL) s = "(null)"; + // For strings, the precision field gives the maximum + // amount of characters to be read from the stream + // Zero/nonspecified precision means unlimited amount + if (prec == 0) prec = INT_MAX; + + for (; *s && prec-- ; s++) { + rc = bputc(buf, (uchar)*s); + } + continue; + } + + // Decimal, unsigned decimal, hexadecimal, octal and binary numbers + else if (type == 'd' || type == 'i') { base = 10; sgn = 1; } + else if (type == 'X') { base = 16; cap = 1; } + else if (type == 'x') { base = 16; } + else if (type == 'u') { base = 10; } + else if (type == 'o') { base = 8; } + else if (type == 'b') { base = 2; } + + // Pointers: %p = %#012lx + // (48-bit pointers have width 12 at least) + else if (type == 'p') { + type = 'x'; base = 16; zero++; hash++; l++; + if (width < 12) width = 12; + } + + // Unknown/unsupported modifier + // Note: a '\0' after length field falls here + else { + rc = EINVAL; + break; + } + + // + // Numerical conversions + // + + // We use s to iterate convbuf + s = convbuf; + + // FIXME: this works, but is ugly as hell + #define bdoconvrt(pref, type, vtype) \ + do { \ + type i_##type = (type)va_arg(ap, vtype); \ + pref##toa(i_##type, s, base); \ + } while (0) + + if (!l) { + if (sgn) { + if (h == 0) bdoconvrt(i, int, int); + if (h == 1) bdoconvrt(i, short, int); + } else { + if (h == 0) bdoconvrt(u, uint, uint); + if (h == 1) bdoconvrt(u, ushort, uint); + } + } + + else { + if (sgn) bdoconvrt(l, long, long); + else bdoconvrt(ul, ulong, ulong); + } + + // + // Implement flags and %X, and prints + // + + // Capital letter digits + if (base > 10 && cap) { + for (; *s ; s++) + if (islower(*s)) *s = toupper(*s); + + // We use this "opportunity" to compute the length of s + len = s - convbuf; + + // Reset s + s = convbuf; + } + + // Compute s's length + // It will always fit in an int + else len = (int)strlen(s); + + // Adjust width + if (sgn && (plus || space)) width--; + else if (hash) width -= (base==8 ? 1 : ((base==2||base==16) ? 2 : 0)); + + // When padding with spaces, we pad before +/-'s etc + if (!minus && !zero && width > len) + bdopadding(buf, width, len, ' '); + + // Deal with signs and the hash flag + if (*s == '-') { rc = bputc(buf, '-'); s++, len--; } + else if (sgn && plus) rc = bputc(buf, '+'); + else if (sgn && space) rc = bputc(buf, ' '); + else bprinthash(buf, base, cap); + + // Deal with padding by zeroes + // The 'minus' flag makes no sense with the 'zero' one + if (zero && width > len) + bdopadding(buf, width, len, '0'); + + // + // Output the actual number + // for (; !rc && *s ; s++) { rc = bputc(buf, (uchar)*s); } - if (rc > 0) goto leave; - goto loop; - } + // 'minus' padding, only with spaces + if (minus && !zero && width > len) + bdopadding(buf, width, base, ' '); + + // Carry on to next modifier + } + + // Assert rc for debugging purposes + assert(!rc); - // Decimal, unsigned decimal, hexadecimal, octal and binary numbers - else if (type == 'd' || type == 'i') { base = 10; sgn = 1; } - else if (type == 'X') { base = 16; cap = 1; } - else if (type == 'x') { base = 16; } - else if (type == 'u') { base = 10; } - else if (type == 'o') { base = 8; } - else if (type == 'b') { base = 2; } - - // Pointers: %p = %#012x - // (48-bit pointers have width 12 at least) - else if (type == 'p') { - type = 'x'; base = 16; zero++; hash++; l++; - if (width < 12) width = 12; - } - - // Unknown/unsupported modifier - else { - rc = EINVAL; - goto leave; - } - -//----------------------------------------------------------------------------// - - // - // Numerical conversions - // - - // We re-use s to iterate convbuf - s = convbuf; - - if (!l) { - if (sgn) { - if (h == 0) bdoconvrt(i, int, int); - if (h == 1) bdoconvrt(i, short, int); - if (h == 2) bdoconvrt(i, char, int); - } else { - if (h == 0) bdoconvrt(u, uint, uint); - if (h == 1) bdoconvrt(u, ushort, uint); - if (h == 2) bdoconvrt(u, uchar, uint); - } - } - - else { - if (sgn) bdoconvrt(l, long, long); - else bdoconvrt(ul, ulong, ulong); - } - -//----------------------------------------------------------------------------// - - // - // Implement flags and %X, and prints - // - - // Capital letter digits - if (base > 10 && cap) { - for (; *s ; s++) - if (islower(*s)) *s = toupper(*s); - - // We use this "opportunity" to compute the length of s - len = s - convbuf; - - // Reset s - s = convbuf; - } - else len = strlen(s); - - // Adjust width - if (sgn && (plus || space)) width--; - else if (hash) width -= (base==8 ? 1 : ((base==2||base==16) ? 2 : 0)); - - // When padding with spaces, we pad before +/-'s etc - if (!minus && !zero && width > len) - bdopadding(buf, width, len, ' '); - - // Deal with signs and the hash flag - if (*s == '-') { rc = bputc(buf, '-'); s++, len--; } - else if (sgn && plus) rc = bputc(buf, '+'); - else if (sgn && space) rc = bputc(buf, ' '); - else bprinthash(buf, base, cap); - - // Deal with padding by zeroes - // The 'minus' flag makes no sense with the 'zero' one - if (zero && width > len) - bdopadding(buf, width, len, '0'); - - // - // Output the actual number - // - for (; !rc && *s ; s++) { - rc = bputc(buf, (uchar)*s); - } - - // 'minus' padding, only with spaces - if (minus && !zero && width > len) - bdopadding(buf, width, base, ' '); - - if (rc > 0) goto leave; - - // Continue parsing fmt - goto loop; - -//----------------------------------------------------------------------------// - -leave: - return rc; + return rc; } diff --git a/kaleid/kernel/proc/sched.c b/kaleid/kernel/ps/sched.c similarity index 100% rename from kaleid/kernel/proc/sched.c rename to kaleid/kernel/ps/sched.c From dc1cfa61510b6f4c6ad28c0cfea2c9396270acfb Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Fri, 5 Apr 2019 10:20:10 +0200 Subject: [PATCH 08/21] Global variable (BootTab/CPU) stuff --- kaleid/include/kernel/base.h | 31 ++++++----- kaleid/include/kernel/mm.h | 4 +- kaleid/include/kernel/panic.h | 2 +- kaleid/include/kernel/proc.h | 4 +- kaleid/include/kernel/sched.h | 8 +-- kaleid/kernel/buf/bprint.c | 13 +++-- kaleid/kernel/init/init.c | 98 +++++++++++++++++------------------ kaleid/kernel/init/table.c | 11 ++-- kaleid/kernel/io/vga.c | 10 ++-- kaleid/kernel/ke/panic.c | 4 +- kaleid/kernel/mm/map.c | 14 ++--- kaleid/kernel/ps/sched.c | 12 ++--- 12 files changed, 107 insertions(+), 104 deletions(-) diff --git a/kaleid/include/kernel/base.h b/kaleid/include/kernel/base.h index 42622ee..3451936 100644 --- a/kaleid/include/kernel/base.h +++ b/kaleid/include/kernel/base.h @@ -60,10 +60,7 @@ typedef enum TermColor_t TermColor_t; #define _KeCurCPU 0 // Process_t structure of current CPU -#define KeCurCPU (cpuTable[_KeCurCPU]) - -// Access the BootInfo_t structure -#define BtGetBootInfo(x) (bootTab.x) +//#define KeCurCPU (cpuTable[_KeCurCPU]) //------------------------------------------// @@ -77,10 +74,13 @@ struct Processor_t // CPU APIC id int apicId; + // CPU Vendor String (always 12 characters) char vendorStr[12]; + // CPU Model code (enum in cpu.h) int modelCode; + // CPU Features flag uint featureFlag; @@ -176,19 +176,24 @@ struct BootInfo_t //------------------------------------------// -extern volatile int cpuCount; -extern volatile BootInfo_t bootTab; -extern volatile Processor_t cpuTable[NCPUS]; +extern int KeCPUCount; +extern Processor_t _KeCPUTable[NCPUS]; + +extern volatile Processor_t *KeCurCPU; +extern volatile BootInfo_t BtBootTab; //------------------------------------------// -#define DEC_PER_CPU(pref, name, field, type) \ - static inline type pref##Get##name() { return KeGetCurCPU().field; } \ - static inline void _##pref##Set##name(type __val) \ - { KeGetCurCPU().field = __val; } +#define DEC_PER_CPU(pref, name, field, type) \ + static inline type pref##Get##name() { return KeGetCurCPU()->field; } \ + static inline void _##pref##Set##name(type __val) \ + { KeGetCurCPU()->field = __val; } -#define BARRIER() do{\ - asm volatile("": : :"memory");__sync_synchronize();}while(0) +#define BARRIER() \ + do { \ + asm volatile("": : :"memory"); \ + __sync_synchronize(); \ + } while(0) //------------------------------------------// diff --git a/kaleid/include/kernel/mm.h b/kaleid/include/kernel/mm.h index c06bd8d..8ee32b1 100644 --- a/kaleid/include/kernel/mm.h +++ b/kaleid/include/kernel/mm.h @@ -66,7 +66,7 @@ struct GdtEntry_t uchar access; // determine what ring this segment can be used in uchar granularity; uchar highBase; // last 8 bits -} __attribute__((packed)); +} __attribute__((__packed__)); // The gdt pointer struct GdtPtr_t @@ -74,7 +74,7 @@ struct GdtPtr_t uchar limit; // upper 16 bits ushort base; // address of the first entry } - __attribute__((packed)); + __attribute__((__packed__)); // -------------------------------------------------------------------------- // diff --git a/kaleid/include/kernel/panic.h b/kaleid/include/kernel/panic.h index 5d97862..d24a16d 100644 --- a/kaleid/include/kernel/panic.h +++ b/kaleid/include/kernel/panic.h @@ -32,7 +32,7 @@ //------------------------------------------// #define PANICSTR_SIZE 1024 -extern volatile char KePanicStr[PANICSTR_SIZE]; +extern volatile bool KeIsPanicking; //------------------------------------------// diff --git a/kaleid/include/kernel/proc.h b/kaleid/include/kernel/proc.h index 2e4e962..6c9f373 100644 --- a/kaleid/include/kernel/proc.h +++ b/kaleid/include/kernel/proc.h @@ -77,8 +77,8 @@ struct Process_t //------------------------------------------// -#define PsCurProc (KeCurCPU.process) -#define PsCurThread (KeCurCPU.thread) +#define PsCurProc (KeCurCPU->process) +#define PsCurThread (KeCurCPU->thread) //DEC_PER_CPU(Ps, CurProc, process, Process_t *); //DEC_PER_CPU(Ps, CurThread, thread, Thread_t *); diff --git a/kaleid/include/kernel/sched.h b/kaleid/include/kernel/sched.h index 76bd799..9c3ae35 100644 --- a/kaleid/include/kernel/sched.h +++ b/kaleid/include/kernel/sched.h @@ -61,10 +61,10 @@ extern const char *PsPrioClassesNames[]; // Re-scheduling and preemption // XXX atomic operations // -#define PsRequestReSched() (++KeCurCPU.needReSched) -#define PsDisablePreemption() (++KeCurCPU.preemptCount) -#define PsEnablePreemption() do { assert(KeCurCPU.preemptCount > 0); \ - --KeCurCPU.preemptCount; } while(0) +#define PsRequestReSched() (++KeCurCPU->needReSched) +#define PsDisablePreemption() (++KeCurCPU->preemptCount) +#define PsEnablePreemption() do { assert(KeCurCPU->preemptCount > 0); \ + --KeCurCPU->preemptCount; } while(0) //------------------------------------------// diff --git a/kaleid/kernel/buf/bprint.c b/kaleid/kernel/buf/bprint.c index 2118a5f..099a968 100644 --- a/kaleid/kernel/buf/bprint.c +++ b/kaleid/kernel/buf/bprint.c @@ -24,7 +24,7 @@ #include -extern error_t bputc(Buffer_t *buf, uchar ch); +error_t bputc(Buffer_t *buf, uchar ch); error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap); // @@ -123,7 +123,7 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) assert(buf && buf->initDone == INITOK); - if (!buf) return EINVAL; + if (!buf || !fmt) return EINVAL; if (buf->state != BS_RDWR && buf->state != BS_WRONLY) { return EBADF; } @@ -241,7 +241,6 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) // // The type field // - type = *fmt++; // Characters @@ -300,10 +299,10 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) s = convbuf; // FIXME: this works, but is ugly as hell - #define bdoconvrt(pref, type, vtype) \ - do { \ - type i_##type = (type)va_arg(ap, vtype); \ - pref##toa(i_##type, s, base); \ + #define bdoconvrt(pref, type, vtype) \ + do { \ + type i_##type = (type)va_arg(ap, vtype); \ + pref##toa(i_##type, s, base); \ } while (0) if (!l) { diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index d0b2eea..9e1bd00 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -44,69 +44,69 @@ void BtInitBootInfo(multiboot_info_t *mbi) KalAlwaysAssert(mbi); //Retrieves the bootloader flags to ensure infos are valid - BtGetBootInfo(btldr).grubFlags = mbi->flags; + BtBootTab.btldr.grubFlags = mbi->flags; - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_BOOT_LOADER_NAME) { - BtGetBootInfo(btldr).grubName = (char*)(ulong)(mbi->boot_loader_name); - BtGetBootInfo(btldr).kernelAddr = (void*)&MB_header; - BtGetBootInfo(btldr).kernelEndAddr = (void*)newKernelEnd; - BtGetBootInfo(btldr).valid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_BOOT_LOADER_NAME) { + BtBootTab.btldr.grubName = (char*)(ulong)(mbi->boot_loader_name); + BtBootTab.btldr.kernelAddr = (void*)&MB_header; + BtBootTab.btldr.kernelEndAddr = (void*)newKernelEnd; + BtBootTab.btldr.valid = 1; } - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_MODS) { - BtGetBootInfo(btldr).modulesCount = mbi->mods_count; - BtGetBootInfo(btldr).modulesAddr = (void*)(ulong)mbi->mods_addr; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MODS) { + BtBootTab.btldr.modulesCount = mbi->mods_count; + BtBootTab.btldr.modulesAddr = (void*)(ulong)mbi->mods_addr; } //Retrieves the drives informations - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_DRIVE_INFO) { - BtGetBootInfo(drives).bufferLength = mbi->drives_length; - BtGetBootInfo(drives).bufferAddr = (void*)(ulong)mbi->drives_addr; - BtGetBootInfo(drives).bufferValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_DRIVE_INFO) { + BtBootTab.drives.bufferLength = mbi->drives_length; + BtBootTab.drives.bufferAddr = (void*)(ulong)mbi->drives_addr; + BtBootTab.drives.bufferValid = 1; } - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_BOOTDEV) { - BtGetBootInfo(drives).bootDrv = mbi->boot_device; - BtGetBootInfo(drives).drvValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_BOOTDEV) { + BtBootTab.drives.bootDrv = mbi->boot_device; + BtBootTab.drives.drvValid = 1; } //Retrieves the memory informations - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_MEMORY) { - BtGetBootInfo(memory).lowMemory = mbi->mem_lower; - BtGetBootInfo(memory).upMemory = mbi->mem_upper; - BtGetBootInfo(memory).memValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MEMORY) { + BtBootTab.memory.lowMemory = mbi->mem_lower; + BtBootTab.memory.upMemory = mbi->mem_upper; + BtBootTab.memory.memValid = 1; } - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_MEM_MAP) { - BtGetBootInfo(memory).mapAddr = (void*)(ulong)mbi->mmap_addr; - BtGetBootInfo(memory).mapLength = mbi->mmap_length; - BtGetBootInfo(memory).mapValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MEM_MAP) { + BtBootTab.memory.mapAddr = (void*)(ulong)mbi->mmap_addr; + BtBootTab.memory.mapLength = mbi->mmap_length; + BtBootTab.memory.mapValid = 1; } // Retrieves video mode informations - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_VBE_INFO) { - BtGetBootInfo(video).vbeControl = (void*)(ulong)mbi->vbe_control_info; - BtGetBootInfo(video).vbeModeInfo = (void*)(ulong)mbi->vbe_mode_info; - BtGetBootInfo(video).vbeMode = mbi->vbe_mode; - BtGetBootInfo(video).vbeInterfaceSeg = mbi->vbe_interface_seg; - BtGetBootInfo(video).vbeInterfaceOff = mbi->vbe_interface_off; - BtGetBootInfo(video).vbeInterfaceLen = mbi->vbe_interface_len; - BtGetBootInfo(video).vbeValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_VBE_INFO) { + BtBootTab.video.vbeControl = (void*)(ulong)mbi->vbe_control_info; + BtBootTab.video.vbeModeInfo = (void*)(ulong)mbi->vbe_mode_info; + BtBootTab.video.vbeMode = mbi->vbe_mode; + BtBootTab.video.vbeInterfaceSeg = mbi->vbe_interface_seg; + BtBootTab.video.vbeInterfaceOff = mbi->vbe_interface_off; + BtBootTab.video.vbeInterfaceLen = mbi->vbe_interface_len; + BtBootTab.video.vbeValid = 1; } - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) { - BtGetBootInfo(video).framebufferAddr = (void*)mbi->framebuffer_addr; - BtGetBootInfo(video).framebufferPitch = mbi->framebuffer_pitch; - BtGetBootInfo(video).framebufferWidth = mbi->framebuffer_width; - BtGetBootInfo(video).framebufferHeight= mbi->framebuffer_height; - BtGetBootInfo(video).framebufferBpp = mbi->framebuffer_bpp; - BtGetBootInfo(video).framebufferType = mbi->framebuffer_type; - BtGetBootInfo(video).fbuValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) { + BtBootTab.video.framebufferAddr = (void*)mbi->framebuffer_addr; + BtBootTab.video.framebufferPitch = mbi->framebuffer_pitch; + BtBootTab.video.framebufferWidth = mbi->framebuffer_width; + BtBootTab.video.framebufferHeight= mbi->framebuffer_height; + BtBootTab.video.framebufferBpp = mbi->framebuffer_bpp; + BtBootTab.video.framebufferType = mbi->framebuffer_type; + BtBootTab.video.fbuValid = 1; } // Retrieves the firmware infos - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_CONFIG_TABLE) { - BtGetBootInfo(firmware).romTable = mbi->config_table; - BtGetBootInfo(firmware).romValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_CONFIG_TABLE) { + BtBootTab.firmware.romTable = mbi->config_table; + BtBootTab.firmware.romValid = 1; } - if (BtGetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_APM_TABLE) { - BtGetBootInfo(firmware).apmTable = mbi->apm_table; - BtGetBootInfo(firmware).apmValid = 1; + if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_APM_TABLE) { + BtBootTab.firmware.apmTable = mbi->apm_table; + BtBootTab.firmware.apmValid = 1; } } @@ -118,11 +118,11 @@ void BtInitSanity(uint mbMagic){ if (!(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC)) KeStartPanic("[Init] Magic number %x is incorrect\n", mbMagic); - tmp = (BtGetBootInfo(btldr).kernelEndAddr - - BtGetBootInfo(btldr).kernelAddr) / KB; + tmp = (BtBootTab.btldr.kernelEndAddr + - BtBootTab.btldr.kernelAddr) / KB; DebugLog("[Init] Kernel successfully loaded at %p with %x magic\n" " and it uses %d Kio\n\n", - BtGetBootInfo(btldr).kernelAddr, + BtBootTab.btldr.kernelAddr, mbMagic,tmp); } diff --git a/kaleid/kernel/init/table.c b/kaleid/kernel/init/table.c index 2878b61..66db3e3 100644 --- a/kaleid/kernel/init/table.c +++ b/kaleid/kernel/init/table.c @@ -24,11 +24,10 @@ #include -volatile int cpuCount = 1; -volatile Processor_t cpuTable[NCPUS] = {0}; +int KeCPUCount = 1; +Processor_t _KeCPUTable[NCPUS] = {0}; -volatile BootInfo_t bootTab = {0}; -Terminal_t *StdOut = 0, *StdDbg = 0; - -volatile char KePanicStr[PANICSTR_SIZE] = {0}; +volatile BootInfo_t BtBootTab = {0}; +volatile bool KeIsPanicking = 0; +volatile Processor_t *KeCurCPU = &_KeCPUTable[0]; diff --git a/kaleid/kernel/io/vga.c b/kaleid/kernel/io/vga.c index 0230143..c5bcd92 100644 --- a/kaleid/kernel/io/vga.c +++ b/kaleid/kernel/io/vga.c @@ -41,7 +41,7 @@ // error_t bvgaflusher(Buffer_t *buf) { - ushort *fbp = BtGetBootInfo(video).framebufferAddr; + ushort *fbp = BtBootTab.video.framebufferAddr; const uchar color = 0xf; uchar *currentLine = buf->wp - buf->lineLen - buf->lastLF; @@ -54,8 +54,8 @@ error_t bvgaflusher(Buffer_t *buf) } const size_t bufSize = buf->nLines * buf->lineLen; - ushort *fbe = BtGetBootInfo(video).framebufferAddr - + (bufSize * sizeof(ushort)); + ushort *fbe = BtBootTab.video.framebufferAddr + + (bufSize * sizeof(ushort)); if (fbp < fbe) { const ushort filler = VGA_ComputeEntry(' ', color); @@ -73,8 +73,8 @@ error_t IoInitVGABuffer(void) static char bvgabuffer[1 * MB]; BStdOut = BOpenLineBuf(bvgabuffer, BS_WRONLY, - BtGetBootInfo(video).framebufferWidth, - BtGetBootInfo(video).framebufferHeight, + BtBootTab.video.framebufferWidth, + BtBootTab.video.framebufferHeight, 8, bvgaflusher); BStdDbg = BStdOut; diff --git a/kaleid/kernel/ke/panic.c b/kaleid/kernel/ke/panic.c index 7e153a5..04a1ae9 100644 --- a/kaleid/kernel/ke/panic.c +++ b/kaleid/kernel/ke/panic.c @@ -62,12 +62,12 @@ noreturn void KeStartPanic(const char *fmt, ...) fmt = "(no message given)"; } - if (KePanicStr[0] != 0) { + if (KeIsPanicking) { vbprintf(BStdOut, "\nDouble panic!", NULL); KeHaltCPU(); } - KePanicStr[0] = 1; + KeIsPanicking = 1; // We don't check vbprintf's output // If it fails, what could we do anyway? diff --git a/kaleid/kernel/mm/map.c b/kaleid/kernel/mm/map.c index 3d39401..9c96699 100644 --- a/kaleid/kernel/mm/map.c +++ b/kaleid/kernel/mm/map.c @@ -52,19 +52,19 @@ static error_t InitMemoryMap(void) uint i = 0; // sanity checks - if (!BtGetBootInfo(memory).memValid && BtGetBootInfo(memory).mapValid) + if (!BtBootTab.memory.memValid && BtBootTab.memory.mapValid) return ENXIO; - if ((BtGetBootInfo(memory).upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) + if ((BtBootTab.memory.upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) return ENOMEM; // Ok then we can work ------------------------------------------------------ // // the memory map provided by GRUB via the BIOS - currentEntry = (multiboot_memory_map_t*)BtGetBootInfo(memory).mapAddr; + currentEntry = (multiboot_memory_map_t*)BtBootTab.memory.mapAddr; // End address of the map mapEnd = (multiboot_memory_map_t*) - ((ulong)currentEntry + (ulong)BtGetBootInfo(memory).mapLength); + ((ulong)currentEntry + (ulong)BtBootTab.memory.mapLength); // fill the map while (currentEntry < mapEnd) { @@ -112,7 +112,7 @@ size_t MmGetAvailZoneSize(void *start) { uint i; // Because the kernel is the kernel - if (start < BtGetBootInfo(btldr).kernelEndAddr) + if (start < BtBootTab.btldr.kernelEndAddr) return 0; // Search the zone where the start address is @@ -137,8 +137,8 @@ void *MmGetFirstAvailZone(void *start) { void *current = 0; // Because the kernel is the kernel - if ((ulong)start < (ulong)BtGetBootInfo(btldr).kernelEndAddr) { - return MmGetFirstAvailZone(BtGetBootInfo(btldr).kernelEndAddr); + if ((ulong)start < (ulong)BtBootTab.btldr.kernelEndAddr) { + return MmGetFirstAvailZone(BtBootTab.btldr.kernelEndAddr); } // Search the zone where the start address is diff --git a/kaleid/kernel/ps/sched.c b/kaleid/kernel/ps/sched.c index 09794bc..31c9781 100644 --- a/kaleid/kernel/ps/sched.c +++ b/kaleid/kernel/ps/sched.c @@ -46,13 +46,13 @@ Process_t procs[] = { //------------------------------------------// -#define ReSchedFlag (KeCurCPU.needReSched) -#define PreemptCount (KeCurCPU.preemptCount) +#define ReSchedFlag (KeCurCPU->needReSched) +#define PreemptCount (KeCurCPU->preemptCount) -#define IdlePrioProcs (KeCurCPU.idlePrioProcs) -#define ReglPrioProcs (KeCurCPU.reglPrioProcs) -#define ServPrioProcs (KeCurCPU.servPrioProcs) -#define TimeCritProcs (KeCurCPU.timeCritProcs) +#define IdlePrioProcs (KeCurCPU->idlePrioProcs) +#define ReglPrioProcs (KeCurCPU->reglPrioProcs) +#define ServPrioProcs (KeCurCPU->servPrioProcs) +#define TimeCritProcs (KeCurCPU->timeCritProcs) //------------------------------------------// From feee90c3d05071399390ead10ac59a0323380bf7 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Sat, 6 Apr 2019 07:53:58 +0200 Subject: [PATCH 09/21] Renaming & restructuration --- Makefile | 87 +++++------ ProjectTree | 136 +++++++++--------- {kaleid/include => include}/base/assert.h | 0 {kaleid/include => include}/base/bdefs.h | 0 {kaleid/include => include}/base/crtlib.h | 0 {kaleid/include => include}/base/errno.h | 0 {kaleid/include => include}/base/limits.h | 0 {kaleid/include => include}/base/masks.h | 0 {kaleid/include => include}/base/types.h | 0 {kaleid/include => include}/extras/argv.h | 0 .../include/kernel => include/extras}/buf.h | 9 +- {kaleid/include => include}/extras/list.h | 0 {kaleid/include => include}/extras/locks.h | 0 {kaleid/include => include}/extras/malloc.h | 9 +- {kaleid/include => include}/extras/prog.h | 0 {kaleid/include => include}/kalbase.h | 0 {kaleid/include => include}/kaleid.h | 0 {kaleid/include => include}/kalext.h | 0 {kaleid/include => include}/kernel/base.h | 109 +++----------- include/kernel/boot.h | 116 +++++++++++++++ {kaleid/include => include}/kernel/cpu.h | 0 {kaleid/include => include}/kernel/heap.h | 0 {kaleid/include => include}/kernel/iomisc.h | 0 {kaleid/include => include}/kernel/mboot.h | 0 {kaleid/include => include}/kernel/mm.h | 0 {kaleid/include => include}/kernel/panic.h | 0 {kaleid/include => include}/kernel/proc.h | 3 - {kaleid/include => include}/kernel/sched.h | 0 kaleid/include/kernel/log.h | 40 ------ kaleid/kernel/init/init.c | 94 ++++++------ kaleid/kernel/init/table.c | 2 +- kaleid/kernel/io/vga.c | 11 +- kaleid/kernel/ke/log.c | 3 +- kaleid/kernel/ke/panic.c | 2 +- kaleid/kernel/mm/heap.c | 1 - kaleid/kernel/mm/malloc.c | 7 +- kaleid/kernel/mm/map.c | 16 +-- kaleid/kernel/ps/sched.c | 21 ++- kaleid/{kernel/buf => libbuf}/bprint.c | 5 +- kaleid/{kernel/buf => libbuf}/bput.c | 3 +- kaleid/{kernel/buf => libbuf}/buf.c | 7 +- kaleid/{crtlib => libc}/atoi.c | 0 kaleid/{crtlib => libc}/ctype.c | 0 kaleid/{crtlib => libc}/itoa.c | 0 kaleid/{crtlib => libc}/mem.c | 12 +- kaleid/{crtlib => libc}/rand.c | 0 kaleid/{crtlib => libc}/sprintf.c | 6 - kaleid/{crtlib => libc}/status.c | 0 kaleid/{crtlib => libc}/string.c | 0 kaleid/{crtlib => libc}/strtol.c | 0 50 files changed, 355 insertions(+), 344 deletions(-) rename {kaleid/include => include}/base/assert.h (100%) rename {kaleid/include => include}/base/bdefs.h (100%) rename {kaleid/include => include}/base/crtlib.h (100%) rename {kaleid/include => include}/base/errno.h (100%) rename {kaleid/include => include}/base/limits.h (100%) rename {kaleid/include => include}/base/masks.h (100%) rename {kaleid/include => include}/base/types.h (100%) rename {kaleid/include => include}/extras/argv.h (100%) rename {kaleid/include/kernel => include/extras}/buf.h (96%) rename {kaleid/include => include}/extras/list.h (100%) rename {kaleid/include => include}/extras/locks.h (100%) rename {kaleid/include => include}/extras/malloc.h (91%) rename {kaleid/include => include}/extras/prog.h (100%) rename {kaleid/include => include}/kalbase.h (100%) rename {kaleid/include => include}/kaleid.h (100%) rename {kaleid/include => include}/kalext.h (100%) rename {kaleid/include => include}/kernel/base.h (65%) create mode 100644 include/kernel/boot.h rename {kaleid/include => include}/kernel/cpu.h (100%) rename {kaleid/include => include}/kernel/heap.h (100%) rename {kaleid/include => include}/kernel/iomisc.h (100%) rename {kaleid/include => include}/kernel/mboot.h (100%) rename {kaleid/include => include}/kernel/mm.h (100%) rename {kaleid/include => include}/kernel/panic.h (100%) rename {kaleid/include => include}/kernel/proc.h (97%) rename {kaleid/include => include}/kernel/sched.h (100%) delete mode 100644 kaleid/include/kernel/log.h rename kaleid/{kernel/buf => libbuf}/bprint.c (99%) rename kaleid/{kernel/buf => libbuf}/bput.c (99%) rename kaleid/{kernel/buf => libbuf}/buf.c (96%) rename kaleid/{crtlib => libc}/atoi.c (100%) rename kaleid/{crtlib => libc}/ctype.c (100%) rename kaleid/{crtlib => libc}/itoa.c (100%) rename kaleid/{crtlib => libc}/mem.c (97%) rename kaleid/{crtlib => libc}/rand.c (100%) rename kaleid/{crtlib => libc}/sprintf.c (96%) rename kaleid/{crtlib => libc}/status.c (100%) rename kaleid/{crtlib => libc}/string.c (100%) rename kaleid/{crtlib => libc}/strtol.c (100%) diff --git a/Makefile b/Makefile index e8d5967..15b8781 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ ASMFLAGS=-f elf64 LDFLAGS=-melf_x86_64 COPTIM=-O2 CWARNS=-Wall -Wextra -Werror=implicit-function-declaration -CINCLUDES=-Ikaleid/include +CINCLUDES=-Iinclude CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 CFLAGS2= -c -g -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fno-strict-aliasing CFLAGS=$(CFLAGS1) $(CFLAGS2) @@ -42,7 +42,8 @@ KCC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES) -D_OSK_SOURCE -D_KALEID #Folders MBRDIR=boot/grub LOADERDIR=boot/loader -KERNELDIR=kaleid +KALEIDDIR=kaleid +INCLUDEDIR=include OBJDIR=build/obj KOBJDIR=build/obj/kaleid LOBJDIR=build/obj/boot @@ -55,7 +56,6 @@ CL2='\033[1;36m' CL3='\033[0m' NC='\033[1;37m' - .PHONY: all all : OS/K @@ -72,55 +72,66 @@ kal_com_obj= $(KOBJDIR)/atoi.o $(KOBJDIR)/ctype.o \ $(KOBJDIR)/utoa.o $(KOBJDIR)/ltoa.o \ $(KOBJDIR)/ultoa.o -$(KOBJDIR)/atoi.o: $(KERNELDIR)/crtlib/atoi.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ATOI $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atol.o: $(KERNELDIR)/crtlib/atoi.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/atol.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ATOL $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atou.o: $(KERNELDIR)/crtlib/atoi.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/atou.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ATOU $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atoul.o: $(KERNELDIR)/crtlib/atoi.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/atoul.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ATOUL $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ctype.o: $(KERNELDIR)/crtlib/ctype.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/ctype.o: $(KALEIDDIR)/libc/ctype.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/itoa.o: $(KERNELDIR)/crtlib/itoa.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ITOA $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ltoa.o: $(KERNELDIR)/crtlib/itoa.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/ltoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_LTOA $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/utoa.o: $(KERNELDIR)/crtlib/itoa.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/utoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_UTOA $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ultoa.o: $(KERNELDIR)/crtlib/itoa.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/ultoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h @$(KCC) -D_NEED_ULTOA $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/mem.o: $(KERNELDIR)/crtlib/mem.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h @$(KCC) -fno-strict-aliasing $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/rand.o: $(KERNELDIR)/crtlib/rand.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/rand.o: $(KALEIDDIR)/libc/rand.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/sprintf.o: $(KERNELDIR)/crtlib/sprintf.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/sprintf.o: $(KALEIDDIR)/libc/sprintf.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/status.o: $(KERNELDIR)/crtlib/status.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/status.o: $(KALEIDDIR)/libc/status.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/string.o: $(KERNELDIR)/crtlib/string.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/string.o: $(KALEIDDIR)/libc/string.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/strtol.o: $(KERNELDIR)/crtlib/strtol.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/strtol.o: $(KALEIDDIR)/libc/strtol.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/argv.o: $(KERNELDIR)/extras/argv.c $(KERNELDIR)/include/*/*.h + +$(KOBJDIR)/argv.o: $(KALEIDDIR)/extras/argv.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/prog.o: $(KERNELDIR)/extras/prog.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/prog.o: $(KALEIDDIR)/extras/prog.c $(INCLUDEDIR)/*/*.h + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} + +$(KOBJDIR)/kernel/buf.o: $(KALEIDDIR)/libbuf/buf.c $(INCLUDEDIR)/*/*.h + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/kernel/bput.o: $(KALEIDDIR)/libbuf/bput.c $(INCLUDEDIR)/*/*.h + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/kernel/bprint.o: $(KALEIDDIR)/libbuf/bprint.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} @@ -134,51 +145,42 @@ kal_kern_obj= $(KOBJDIR)/kernel/cpuid.o $(KOBJDIR)/kernel/init.o \ $(KOBJDIR)/kernel/bput.o $(KOBJDIR)/kernel/bprint.o \ $(KOBJDIR)/kernel/gdt.o -$(KOBJDIR)/kernel/cpuid.o: $(KERNELDIR)/kernel/cpu/cpuid.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/cpuid.o: $(KALEIDDIR)/kernel/cpu/cpuid.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/idt.o: $(KERNELDIR)/kernel/cpu/idt.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/idt.o: $(KALEIDDIR)/kernel/cpu/idt.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/init.o: $(KERNELDIR)/kernel/init/init.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/init.o: $(KALEIDDIR)/kernel/init/init.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/table.o: $(KERNELDIR)/kernel/init/table.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/table.o: $(KALEIDDIR)/kernel/init/table.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/cursor.o: $(KERNELDIR)/kernel/io/cursor.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/cursor.o: $(KALEIDDIR)/kernel/io/cursor.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/log.o: $(KERNELDIR)/kernel/ke/log.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/log.o: $(KALEIDDIR)/kernel/ke/log.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/vga.o: $(KERNELDIR)/kernel/io/vga.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/vga.o: $(KALEIDDIR)/kernel/io/vga.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/panic.o: $(KERNELDIR)/kernel/ke/panic.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/panic.o: $(KALEIDDIR)/kernel/ke/panic.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/map.o: $(KERNELDIR)/kernel/mm/map.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/map.o: $(KALEIDDIR)/kernel/mm/map.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/heap.o: $(KERNELDIR)/kernel/mm/heap.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/heap.o: $(KALEIDDIR)/kernel/mm/heap.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/malloc.o: $(KERNELDIR)/kernel/mm/malloc.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/malloc.o: $(KALEIDDIR)/kernel/mm/malloc.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ -$(KOBJDIR)/kernel/gdt.o: $(KERNELDIR)/kernel/mm/gdt.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/gdt.o: $(KALEIDDIR)/kernel/mm/gdt.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/buf.o: $(KERNELDIR)/kernel/buf/buf.c $(KERNELDIR)/include/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/bput.o: $(KERNELDIR)/kernel/buf/bput.c $(KERNELDIR)/include/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/bprint.o: $(KERNELDIR)/kernel/buf/bprint.c $(KERNELDIR)/include/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/sched.o: $(KERNELDIR)/kernel/ps/sched.c $(KERNELDIR)/include/*/*.h +$(KOBJDIR)/kernel/sched.o: $(KALEIDDIR)/kernel/ps/sched.c $(INCLUDEDIR)/*/*.h @$(KCC) $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} @@ -189,6 +191,7 @@ $(KOBJDIR)/kernel/sched.o: $(KERNELDIR)/kernel/ps/sched.c $(KERNELDIR)/include/* @echo "\n" >> ./ProjectTree @tree --dirsfirst >> ./ProjectTree @echo ${CL2}[$@] ${CL}Generated.${CL3} + ## MAIN MAKEFILE ------------------------------------------------------------- # .PHONY: test diff --git a/ProjectTree b/ProjectTree index 9daa4e3..41c126d 100644 --- a/ProjectTree +++ b/ProjectTree @@ -89,82 +89,82 @@ │   │   ├── ultoa.o │   │   └── utoa.o │   ├── grub.log -│   └── kernel.ld +│   ├── kernel.ld +│   └── qemu.log +├── include +│   ├── base +│   │   ├── assert.h +│   │   ├── bdefs.h +│   │   ├── crtlib.h +│   │   ├── errno.h +│   │   ├── limits.h +│   │   ├── masks.h +│   │   └── types.h +│   ├── extras +│   │   ├── argv.h +│   │   ├── buf.h +│   │   ├── list.h +│   │   ├── locks.h +│   │   ├── malloc.h +│   │   └── prog.h +│   ├── kernel +│   │   ├── base.h +│   │   ├── boot.h +│   │   ├── cpu.h +│   │   ├── heap.h +│   │   ├── iomisc.h +│   │   ├── mboot.h +│   │   ├── mm.h +│   │   ├── panic.h +│   │   ├── proc.h +│   │   └── sched.h +│   ├── kalbase.h +│   ├── kaleid.h +│   └── kalext.h ├── kaleid -│   ├── crtlib -│   │   ├── atoi.c -│   │   ├── ctype.c -│   │   ├── itoa.c -│   │   ├── mem.c -│   │   ├── rand.c -│   │   ├── sprintf.c -│   │   ├── status.c -│   │   ├── string.c -│   │   └── strtol.c │   ├── extras │   │   ├── argv.c │   │   └── prog.c -│   ├── include -│   │   ├── base -│   │   │   ├── assert.h -│   │   │   ├── bdefs.h -│   │   │   ├── crtlib.h -│   │   │   ├── errno.h -│   │   │   ├── limits.h -│   │   │   ├── masks.h -│   │   │   └── types.h -│   │   ├── extras -│   │   │   ├── argv.h -│   │   │   ├── list.h -│   │   │   ├── locks.h -│   │   │   ├── malloc.h -│   │   │   └── prog.h -│   │   ├── kernel -│   │   │   ├── base.h -│   │   │   ├── buf.h -│   │   │   ├── cpu.h -│   │   │   ├── heap.h -│   │   │   ├── iomisc.h -│   │   │   ├── log.h -│   │   │   ├── mboot.h -│   │   │   ├── mm.h -│   │   │   ├── panic.h -│   │   │   ├── proc.h -│   │   │   └── sched.h -│   │   ├── kalbase.h -│   │   ├── kaleid.h -│   │   └── kalext.h -│   └── kernel -│   ├── buf -│   │   ├── bprint.c -│   │   ├── bput.c -│   │   └── buf.c -│   ├── cpu -│   │   ├── cpuid.c -│   │   └── idt.c -│   ├── init -│   │   ├── init.c -│   │   └── table.c -│   ├── io -│   │   ├── ata.inc -│   │   ├── cursor.c -│   │   └── vga.c -│   ├── ke -│   │   ├── log.c -│   │   └── panic.c -│   ├── mm -│   │   ├── gdt.c -│   │   ├── heap.c -│   │   ├── malloc.c -│   │   └── map.c -│   └── proc -│   ├── Makefile -│   └── sched.c +│   ├── kernel +│   │   ├── cpu +│   │   │   ├── cpuid.c +│   │   │   └── idt.c +│   │   ├── init +│   │   │   ├── init.c +│   │   │   └── table.c +│   │   ├── io +│   │   │   ├── ata.inc +│   │   │   ├── cursor.c +│   │   │   └── vga.c +│   │   ├── ke +│   │   │   ├── log.c +│   │   │   └── panic.c +│   │   ├── mm +│   │   │   ├── gdt.c +│   │   │   ├── heap.c +│   │   │   ├── malloc.c +│   │   │   └── map.c +│   │   └── ps +│   │   └── sched.c +│   ├── libbuf +│   │   ├── bprint.c +│   │   ├── bput.c +│   │   └── buf.c +│   └── libc +│   ├── atoi.c +│   ├── ctype.c +│   ├── itoa.c +│   ├── mem.c +│   ├── rand.c +│   ├── sprintf.c +│   ├── status.c +│   ├── string.c +│   └── strtol.c ├── AUTHORS ├── ChangeLog ├── COPYING ├── Makefile ├── ProjectTree -└── Readme.md +└── README.md 28 directories, 114 files diff --git a/kaleid/include/base/assert.h b/include/base/assert.h similarity index 100% rename from kaleid/include/base/assert.h rename to include/base/assert.h diff --git a/kaleid/include/base/bdefs.h b/include/base/bdefs.h similarity index 100% rename from kaleid/include/base/bdefs.h rename to include/base/bdefs.h diff --git a/kaleid/include/base/crtlib.h b/include/base/crtlib.h similarity index 100% rename from kaleid/include/base/crtlib.h rename to include/base/crtlib.h diff --git a/kaleid/include/base/errno.h b/include/base/errno.h similarity index 100% rename from kaleid/include/base/errno.h rename to include/base/errno.h diff --git a/kaleid/include/base/limits.h b/include/base/limits.h similarity index 100% rename from kaleid/include/base/limits.h rename to include/base/limits.h diff --git a/kaleid/include/base/masks.h b/include/base/masks.h similarity index 100% rename from kaleid/include/base/masks.h rename to include/base/masks.h diff --git a/kaleid/include/base/types.h b/include/base/types.h similarity index 100% rename from kaleid/include/base/types.h rename to include/base/types.h diff --git a/kaleid/include/extras/argv.h b/include/extras/argv.h similarity index 100% rename from kaleid/include/extras/argv.h rename to include/extras/argv.h diff --git a/kaleid/include/kernel/buf.h b/include/extras/buf.h similarity index 96% rename from kaleid/include/kernel/buf.h rename to include/extras/buf.h index 05c876f..bc9c2c9 100644 --- a/kaleid/include/kernel/buf.h +++ b/include/extras/buf.h @@ -22,12 +22,12 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#ifndef _KALKERN_BASE_H -#include +#ifndef _KALEXTRAS_LOCKS_H +#include #endif -#ifndef _KALKERN_BUF_H -#define _KALKERN_BUF_H +#ifndef _KALEXTRAS_BUF_H +#define _KALEXTRAS_BUF_H // // Buffer flags @@ -55,6 +55,7 @@ enum BS_WRONLY, // Only for writing }; +typedef struct Buffer_t Buffer_t; typedef error_t (*BFlusher_t)(Buffer_t *); struct Buffer_t diff --git a/kaleid/include/extras/list.h b/include/extras/list.h similarity index 100% rename from kaleid/include/extras/list.h rename to include/extras/list.h diff --git a/kaleid/include/extras/locks.h b/include/extras/locks.h similarity index 100% rename from kaleid/include/extras/locks.h rename to include/extras/locks.h diff --git a/kaleid/include/extras/malloc.h b/include/extras/malloc.h similarity index 91% rename from kaleid/include/extras/malloc.h rename to include/extras/malloc.h index 6c478c9..9d69f35 100644 --- a/kaleid/include/extras/malloc.h +++ b/include/extras/malloc.h @@ -35,7 +35,7 @@ extern "C" { //------------------------------------------// -// Flags for KalAllocMemory +// Flags for KalAllocMemoryEx enum { // Return zeroed-out memory @@ -51,17 +51,18 @@ enum enum { // Default memory allocation alignment (in bytes) - // Asking KalAllocMemory for an alignment of 0 + // Asking KalAllocMemoryEx for an alignment of 0 // will cause it to use this value M_DEFAULT_ALIGNMENT = alignof(QWORD), // Minimal memory allocation alignment (in bytes) - // Asking KalAllocMemory for an nonzero alignment + // Asking KalAllocMemoryEx for an nonzero alignment // lower than this value will cause a EALIGN error M_MINIMAL_ALIGNMENT = M_DEFAULT_ALIGNMENT }; -error_t KalAllocMemory(void **ptr, size_t req, int flags, size_t align); +error_t KalAllocMemoryEx(void **ptr, size_t req, int flags, size_t align); +error_t KalAllocMemory(void **ptr, size_t req); error_t KalFreeMemory(void *ptr); //------------------------------------------// diff --git a/kaleid/include/extras/prog.h b/include/extras/prog.h similarity index 100% rename from kaleid/include/extras/prog.h rename to include/extras/prog.h diff --git a/kaleid/include/kalbase.h b/include/kalbase.h similarity index 100% rename from kaleid/include/kalbase.h rename to include/kalbase.h diff --git a/kaleid/include/kaleid.h b/include/kaleid.h similarity index 100% rename from kaleid/include/kaleid.h rename to include/kaleid.h diff --git a/kaleid/include/kalext.h b/include/kalext.h similarity index 100% rename from kaleid/include/kalext.h rename to include/kalext.h diff --git a/kaleid/include/kernel/base.h b/include/kernel/base.h similarity index 65% rename from kaleid/include/kernel/base.h rename to include/kernel/base.h index 3451936..27b7225 100644 --- a/kaleid/include/kernel/base.h +++ b/include/kernel/base.h @@ -39,28 +39,12 @@ typedef struct Lock_t Lock_t; typedef struct Buffer_t Buffer_t; typedef struct Thread_t Thread_t; typedef struct Process_t Process_t; -typedef struct Terminal_t Terminal_t; +typedef struct BootInfo_t BootInfo_t; typedef struct ListHead_t ListHead_t; typedef struct ListNode_t ListNode_t; typedef struct Processor_t Processor_t; -typedef struct BootInfo_t BootInfo_t; typedef enum ProcState_t ProcState_t; -typedef enum TermColor_t TermColor_t; - -//------------------------------------------// -// Multiprocessor misc. // -//------------------------------------------// - -#ifndef NCPUS -#define NCPUS 1 -#endif - -// Current CPU number -#define _KeCurCPU 0 - -// Process_t structure of current CPU -//#define KeCurCPU (cpuTable[_KeCurCPU]) //------------------------------------------// @@ -104,83 +88,18 @@ struct Processor_t ListHead_t *timeCritProcs; }; -#define FB_EGA_TEXT 2 -#define FB_INDEXED 0 -#define FB_RGB 1 -#define BINFO_SIZE 4096 - -struct BootInfo_t -{ - // The Bootloader infos (GRUB in our case) - struct { - ushort valid; - uint grubFlags; //flags - uint modulesCount; //mods_count - void *modulesAddr; //mods_addr - char *grubName; //boot_loader_name - void *kernelAddr; - void *kernelEndAddr; - } btldr; - - // Informations about drives - struct { - ushort drvValid; - ushort bufferValid; - uint bootDrv; //boot_device - uint bufferLength; //drives_length - void *bufferAddr; //drives_addr - } drives; - - // Informations about memory - struct { - ushort memValid; - ushort mapValid; - - //BIOS provided low and up memory - uint lowMemory; //mem_lower - uint upMemory; //mem_upper - - //GRUB provided memory map - uint mapLength; //mmap_length - void *mapAddr; //mmap_addr - - uint ramSize; //The ram (init by map.c) - } memory; - - // Informations about the video drive - struct { - ushort vbeValid; - ushort fbuValid; - void *vbeControl; //vbe_control_info - void *vbeModeInfo; //vbe_mode_info - ushort vbeMode; //vbe_mode - ushort vbeInterfaceSeg; //vbe_interface_seg - ushort vbeInterfaceOff; //vbe_interface_off - ushort vbeInterfaceLen; //vbe_interface_len - void *framebufferAddr; //framebuffer_addr - uint framebufferPitch; //framebuffer_pitch - uint framebufferWidth; //framebuffer_width - uint framebufferHeight; //framebuffer_height - uchar framebufferBpp; //framebuffer_bpp - uchar framebufferType; //framebuffer_type - } video; - - // Informations about the microcode firmware (BIOS/EFI) - struct { - ushort apmValid; - ushort romValid; - uint apmTable; //apm_table - uint romTable; //config_table - } firmware; -}; - //------------------------------------------// -extern int KeCPUCount; -extern Processor_t _KeCPUTable[NCPUS]; +#ifndef NCPUS +#define NCPUS 1 +#endif +// Current CPU number +#define _KeCurCPU 0 + +extern int KeCPUCount; extern volatile Processor_t *KeCurCPU; -extern volatile BootInfo_t BtBootTab; +extern Processor_t _KeCPUTable[NCPUS]; //------------------------------------------// @@ -197,6 +116,16 @@ extern volatile BootInfo_t BtBootTab; //------------------------------------------// +error_t KernLog(const char *, ...); + +#ifndef _NO_DEBUG +void DebugLog(const char *, ...); +#else +#define DebugLog(fmt, ...) ((void)0) +#endif + +//------------------------------------------// + // Needed by basically everyone #ifndef _KALEXTRAS_LOCKS_H #include diff --git a/include/kernel/boot.h b/include/kernel/boot.h new file mode 100644 index 0000000..f59f332 --- /dev/null +++ b/include/kernel/boot.h @@ -0,0 +1,116 @@ +//----------------------------------------------------------------------------// +// GNU GPL OS/K // +// // +// Desc: Kaleid kernel base include file // +// // +// // +// Copyright © 2018-2019 The OS/K Team // +// // +// This file is part of OS/K. // +// // +// OS/K is free software: you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation, either version 3 of the License, or // +// any later version. // +// // +// OS/K is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY//without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with OS/K. If not, see . // +//----------------------------------------------------------------------------// + +#ifndef _KALKERN_BASE_H +#include +#endif + +#ifndef _KALKERN_BOOT_H +#define _KALKERN_BOOT_H + +//------------------------------------------// + +#define FB_EGA_TEXT 2 +#define FB_INDEXED 0 +#define FB_RGB 1 +#define BINFO_SIZE 4096 + +struct BootInfo_t +{ + // The Bootloader infos + struct { + ushort valid; + uint grubFlags; //flags + uint modulesCount; //mods_count + void *modulesAddr; //mods_addr + char *grubName; //boot_loader_name + void *kernelAddr; + void *kernelEndAddr; + } btldr; + + // Informations about drives + struct { + ushort drvValid; + ushort bufferValid; + uint bootDrv; //boot_device + uint bufferLength; //drives_length + void *bufferAddr; //drives_addr + } drives; + + // Informations about memory + struct { + ushort memValid; + ushort mapValid; + + //BIOS provided low and up memory + uint lowMemory; //mem_lower + uint upMemory; //mem_upper + + //GRUB provided memory map + uint mapLength; //mmap_length + void *mapAddr; //mmap_addr + + uint ramSize; //The ram (init by map.c) + } memory; + + // Informations about the video drive + struct { + ushort vbeValid; + ushort fbuValid; + void *vbeControl; //vbe_control_info + void *vbeModeInfo; //vbe_mode_info + ushort vbeMode; //vbe_mode + ushort vbeInterfaceSeg; //vbe_interface_seg + ushort vbeInterfaceOff; //vbe_interface_off + ushort vbeInterfaceLen; //vbe_interface_len + void *framebufferAddr; //framebuffer_addr + uint framebufferPitch; //framebuffer_pitch + uint framebufferWidth; //framebuffer_width + uint framebufferHeight; //framebuffer_height + uchar framebufferBpp; //framebuffer_bpp + uchar framebufferType; //framebuffer_type + } video; + + // Informations about the microcode firmware (BIOS/EFI) + struct { + ushort apmValid; + ushort romValid; + uint apmTable; //apm_table + uint romTable; //config_table + } firmware; +}; + +//------------------------------------------// + +extern volatile BootInfo_t BtBootTab; + +#define BtLoaderInfo (BtBootTab.btldr) +#define BtDrivesInfo (BtBootTab.drives) +#define BtMemoryInfo (BtBootTab.memory) +#define BtVideoInfo (BtBootTab.video) +#define BtFirmwareInfo (BtBootTab.firmware) + +//------------------------------------------// + +#endif diff --git a/kaleid/include/kernel/cpu.h b/include/kernel/cpu.h similarity index 100% rename from kaleid/include/kernel/cpu.h rename to include/kernel/cpu.h diff --git a/kaleid/include/kernel/heap.h b/include/kernel/heap.h similarity index 100% rename from kaleid/include/kernel/heap.h rename to include/kernel/heap.h diff --git a/kaleid/include/kernel/iomisc.h b/include/kernel/iomisc.h similarity index 100% rename from kaleid/include/kernel/iomisc.h rename to include/kernel/iomisc.h diff --git a/kaleid/include/kernel/mboot.h b/include/kernel/mboot.h similarity index 100% rename from kaleid/include/kernel/mboot.h rename to include/kernel/mboot.h diff --git a/kaleid/include/kernel/mm.h b/include/kernel/mm.h similarity index 100% rename from kaleid/include/kernel/mm.h rename to include/kernel/mm.h diff --git a/kaleid/include/kernel/panic.h b/include/kernel/panic.h similarity index 100% rename from kaleid/include/kernel/panic.h rename to include/kernel/panic.h diff --git a/kaleid/include/kernel/proc.h b/include/kernel/proc.h similarity index 97% rename from kaleid/include/kernel/proc.h rename to include/kernel/proc.h index 6c9f373..a8930e9 100644 --- a/kaleid/include/kernel/proc.h +++ b/include/kernel/proc.h @@ -70,9 +70,6 @@ struct Process_t // Scheduler internals ListNode_t *schedNode; - - // Standard output/debug - Terminal_t *stdOut, *stdDbg; }; //------------------------------------------// diff --git a/kaleid/include/kernel/sched.h b/include/kernel/sched.h similarity index 100% rename from kaleid/include/kernel/sched.h rename to include/kernel/sched.h diff --git a/kaleid/include/kernel/log.h b/kaleid/include/kernel/log.h deleted file mode 100644 index fe88a6e..0000000 --- a/kaleid/include/kernel/log.h +++ /dev/null @@ -1,40 +0,0 @@ -//----------------------------------------------------------------------------// -// GNU GPL OS/K // -// // -// Desc: KernLog() and DebugLog() // -// // -// // -// Copyright © 2018-2019 The OS/K Team // -// // -// This file is part of OS/K. // -// // -// OS/K is free software: you can redistribute it and/or modify // -// it under the terms of the GNU General Public License as published by // -// the Free Software Foundation, either version 3 of the License, or // -// any later version. // -// // -// OS/K is distributed in the hope that it will be useful, // -// but WITHOUT ANY WARRANTY//without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // -// GNU General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with OS/K. If not, see . // -//----------------------------------------------------------------------------// - -#ifndef _KALKERN_BASE_H -#include -#endif - -#ifndef _KALKERN_LOG_H -#define _KALKERN_LOG_H - -error_t KernLog(const char *, ...); - -#ifndef _NO_DEBUG -void DebugLog(const char *, ...); -#else // _NO_DEBUG -#define DebugLog(fmt, ...) -#endif - -#endif diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 9e1bd00..a0e978b 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -26,11 +26,9 @@ #include #include #include -#include -#include +#include #include - // // BootInfo_t initialization. It is necessary because grub will potentially be // wiped since it is below 1MB.... And we must reorganize all that stuff. @@ -44,69 +42,69 @@ void BtInitBootInfo(multiboot_info_t *mbi) KalAlwaysAssert(mbi); //Retrieves the bootloader flags to ensure infos are valid - BtBootTab.btldr.grubFlags = mbi->flags; + BtLoaderInfo.grubFlags = mbi->flags; - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_BOOT_LOADER_NAME) { - BtBootTab.btldr.grubName = (char*)(ulong)(mbi->boot_loader_name); - BtBootTab.btldr.kernelAddr = (void*)&MB_header; - BtBootTab.btldr.kernelEndAddr = (void*)newKernelEnd; - BtBootTab.btldr.valid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_BOOT_LOADER_NAME) { + BtLoaderInfo.grubName = (char*)(ulong)(mbi->boot_loader_name); + BtLoaderInfo.kernelAddr = (void*)&MB_header; + BtLoaderInfo.kernelEndAddr = (void*)newKernelEnd; + BtLoaderInfo.valid = 1; } - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MODS) { - BtBootTab.btldr.modulesCount = mbi->mods_count; - BtBootTab.btldr.modulesAddr = (void*)(ulong)mbi->mods_addr; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_MODS) { + BtLoaderInfo.modulesCount = mbi->mods_count; + BtLoaderInfo.modulesAddr = (void*)(ulong)mbi->mods_addr; } //Retrieves the drives informations - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_DRIVE_INFO) { + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_DRIVE_INFO) { BtBootTab.drives.bufferLength = mbi->drives_length; BtBootTab.drives.bufferAddr = (void*)(ulong)mbi->drives_addr; BtBootTab.drives.bufferValid = 1; } - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_BOOTDEV) { + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_BOOTDEV) { BtBootTab.drives.bootDrv = mbi->boot_device; BtBootTab.drives.drvValid = 1; } //Retrieves the memory informations - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MEMORY) { - BtBootTab.memory.lowMemory = mbi->mem_lower; - BtBootTab.memory.upMemory = mbi->mem_upper; - BtBootTab.memory.memValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_MEMORY) { + BtMemoryInfo.lowMemory = mbi->mem_lower; + BtMemoryInfo.upMemory = mbi->mem_upper; + BtMemoryInfo.memValid = 1; } - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_MEM_MAP) { - BtBootTab.memory.mapAddr = (void*)(ulong)mbi->mmap_addr; - BtBootTab.memory.mapLength = mbi->mmap_length; - BtBootTab.memory.mapValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_MEM_MAP) { + BtMemoryInfo.mapAddr = (void*)(ulong)mbi->mmap_addr; + BtMemoryInfo.mapLength = mbi->mmap_length; + BtMemoryInfo.mapValid = 1; } // Retrieves video mode informations - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_VBE_INFO) { - BtBootTab.video.vbeControl = (void*)(ulong)mbi->vbe_control_info; - BtBootTab.video.vbeModeInfo = (void*)(ulong)mbi->vbe_mode_info; - BtBootTab.video.vbeMode = mbi->vbe_mode; - BtBootTab.video.vbeInterfaceSeg = mbi->vbe_interface_seg; - BtBootTab.video.vbeInterfaceOff = mbi->vbe_interface_off; - BtBootTab.video.vbeInterfaceLen = mbi->vbe_interface_len; - BtBootTab.video.vbeValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_VBE_INFO) { + BtVideoInfo.vbeControl = (void*)(ulong)mbi->vbe_control_info; + BtVideoInfo.vbeModeInfo = (void*)(ulong)mbi->vbe_mode_info; + BtVideoInfo.vbeMode = mbi->vbe_mode; + BtVideoInfo.vbeInterfaceSeg = mbi->vbe_interface_seg; + BtVideoInfo.vbeInterfaceOff = mbi->vbe_interface_off; + BtVideoInfo.vbeInterfaceLen = mbi->vbe_interface_len; + BtVideoInfo.vbeValid = 1; } - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) { - BtBootTab.video.framebufferAddr = (void*)mbi->framebuffer_addr; - BtBootTab.video.framebufferPitch = mbi->framebuffer_pitch; - BtBootTab.video.framebufferWidth = mbi->framebuffer_width; - BtBootTab.video.framebufferHeight= mbi->framebuffer_height; - BtBootTab.video.framebufferBpp = mbi->framebuffer_bpp; - BtBootTab.video.framebufferType = mbi->framebuffer_type; - BtBootTab.video.fbuValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) { + BtVideoInfo.framebufferAddr = (void*)mbi->framebuffer_addr; + BtVideoInfo.framebufferPitch = mbi->framebuffer_pitch; + BtVideoInfo.framebufferWidth = mbi->framebuffer_width; + BtVideoInfo.framebufferHeight= mbi->framebuffer_height; + BtVideoInfo.framebufferBpp = mbi->framebuffer_bpp; + BtVideoInfo.framebufferType = mbi->framebuffer_type; + BtVideoInfo.fbuValid = 1; } // Retrieves the firmware infos - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_CONFIG_TABLE) { - BtBootTab.firmware.romTable = mbi->config_table; - BtBootTab.firmware.romValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_CONFIG_TABLE) { + BtFirmwareInfo.romTable = mbi->config_table; + BtFirmwareInfo.romValid = 1; } - if (BtBootTab.btldr.grubFlags & MULTIBOOT_INFO_APM_TABLE) { - BtBootTab.firmware.apmTable = mbi->apm_table; - BtBootTab.firmware.apmValid = 1; + if (BtLoaderInfo.grubFlags & MULTIBOOT_INFO_APM_TABLE) { + BtFirmwareInfo.apmTable = mbi->apm_table; + BtFirmwareInfo.apmValid = 1; } } @@ -118,11 +116,11 @@ void BtInitSanity(uint mbMagic){ if (!(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC)) KeStartPanic("[Init] Magic number %x is incorrect\n", mbMagic); - tmp = (BtBootTab.btldr.kernelEndAddr - - BtBootTab.btldr.kernelAddr) / KB; + tmp = (BtLoaderInfo.kernelEndAddr + - BtLoaderInfo.kernelAddr) / KB; DebugLog("[Init] Kernel successfully loaded at %p with %x magic\n" " and it uses %d Kio\n\n", - BtBootTab.btldr.kernelAddr, + BtLoaderInfo.kernelAddr, mbMagic,tmp); } @@ -152,7 +150,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) MmInitHeap(); PsInitSched(); - KeStartPanic("Test Panic %d", 4); + KeStartPanic("Test Panic %x", 4); // End this machine's suffering KeCrashSystem(); diff --git a/kaleid/kernel/init/table.c b/kaleid/kernel/init/table.c index 66db3e3..0261a15 100644 --- a/kaleid/kernel/init/table.c +++ b/kaleid/kernel/init/table.c @@ -22,7 +22,7 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include int KeCPUCount = 1; Processor_t _KeCPUTable[NCPUS] = {0}; diff --git a/kaleid/kernel/io/vga.c b/kaleid/kernel/io/vga.c index c5bcd92..2500836 100644 --- a/kaleid/kernel/io/vga.c +++ b/kaleid/kernel/io/vga.c @@ -22,7 +22,8 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include +#include //----------------------------------------------------------// // Internal functions for VGA terminals // @@ -41,7 +42,7 @@ // error_t bvgaflusher(Buffer_t *buf) { - ushort *fbp = BtBootTab.video.framebufferAddr; + ushort *fbp = BtVideoInfo.framebufferAddr; const uchar color = 0xf; uchar *currentLine = buf->wp - buf->lineLen - buf->lastLF; @@ -54,7 +55,7 @@ error_t bvgaflusher(Buffer_t *buf) } const size_t bufSize = buf->nLines * buf->lineLen; - ushort *fbe = BtBootTab.video.framebufferAddr + ushort *fbe = BtVideoInfo.framebufferAddr + (bufSize * sizeof(ushort)); if (fbp < fbe) { @@ -73,8 +74,8 @@ error_t IoInitVGABuffer(void) static char bvgabuffer[1 * MB]; BStdOut = BOpenLineBuf(bvgabuffer, BS_WRONLY, - BtBootTab.video.framebufferWidth, - BtBootTab.video.framebufferHeight, + BtVideoInfo.framebufferWidth, + BtVideoInfo.framebufferHeight, 8, bvgaflusher); BStdDbg = BStdOut; diff --git a/kaleid/kernel/ke/log.c b/kaleid/kernel/ke/log.c index e590864..0058911 100644 --- a/kaleid/kernel/ke/log.c +++ b/kaleid/kernel/ke/log.c @@ -22,7 +22,8 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include +#include // // Prints formatted string on standard output diff --git a/kaleid/kernel/ke/panic.c b/kaleid/kernel/ke/panic.c index 04a1ae9..ecc5dd6 100644 --- a/kaleid/kernel/ke/panic.c +++ b/kaleid/kernel/ke/panic.c @@ -22,7 +22,7 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include #include #include #include diff --git a/kaleid/kernel/mm/heap.c b/kaleid/kernel/mm/heap.c index d79c8dd..8f44142 100644 --- a/kaleid/kernel/mm/heap.c +++ b/kaleid/kernel/mm/heap.c @@ -23,7 +23,6 @@ //----------------------------------------------------------------------------// #include -#include #include // Least address out of the heap diff --git a/kaleid/kernel/mm/malloc.c b/kaleid/kernel/mm/malloc.c index 1b7de5c..c6b5730 100644 --- a/kaleid/kernel/mm/malloc.c +++ b/kaleid/kernel/mm/malloc.c @@ -25,7 +25,12 @@ #include #include -error_t KalAllocMemory(void **ptr, size_t req, int flags, size_t align) +error_t KalAllocMemory(void **ptr, size_t req) +{ + return KalAllocMemoryEx(ptr, req, 0, 0); +} + +error_t KalAllocMemoryEx(void **ptr, size_t req, int flags, size_t align) { error_t rc; size_t brk; diff --git a/kaleid/kernel/mm/map.c b/kaleid/kernel/mm/map.c index 9c96699..a833ccb 100644 --- a/kaleid/kernel/mm/map.c +++ b/kaleid/kernel/mm/map.c @@ -23,7 +23,7 @@ //----------------------------------------------------------------------------// #include -#include +#include #include // Initializes globally the memory map @@ -52,19 +52,19 @@ static error_t InitMemoryMap(void) uint i = 0; // sanity checks - if (!BtBootTab.memory.memValid && BtBootTab.memory.mapValid) + if (!BtMemoryInfo.memValid && BtMemoryInfo.mapValid) return ENXIO; - if ((BtBootTab.memory.upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) + if ((BtMemoryInfo.upMemory / (MB/KB)) <= MINIMUM_RAM_SIZE) return ENOMEM; // Ok then we can work ------------------------------------------------------ // // the memory map provided by GRUB via the BIOS - currentEntry = (multiboot_memory_map_t*)BtBootTab.memory.mapAddr; + currentEntry = (multiboot_memory_map_t*)BtMemoryInfo.mapAddr; // End address of the map mapEnd = (multiboot_memory_map_t*) - ((ulong)currentEntry + (ulong)BtBootTab.memory.mapLength); + ((ulong)currentEntry + (ulong)BtMemoryInfo.mapLength); // fill the map while (currentEntry < mapEnd) { @@ -112,7 +112,7 @@ size_t MmGetAvailZoneSize(void *start) { uint i; // Because the kernel is the kernel - if (start < BtBootTab.btldr.kernelEndAddr) + if (start < BtLoaderInfo.kernelEndAddr) return 0; // Search the zone where the start address is @@ -137,8 +137,8 @@ void *MmGetFirstAvailZone(void *start) { void *current = 0; // Because the kernel is the kernel - if ((ulong)start < (ulong)BtBootTab.btldr.kernelEndAddr) { - return MmGetFirstAvailZone(BtBootTab.btldr.kernelEndAddr); + if ((ulong)start < (ulong)BtLoaderInfo.kernelEndAddr) { + return MmGetFirstAvailZone(BtLoaderInfo.kernelEndAddr); } // Search the zone where the start address is diff --git a/kaleid/kernel/ps/sched.c b/kaleid/kernel/ps/sched.c index 31c9781..4fdf459 100644 --- a/kaleid/kernel/ps/sched.c +++ b/kaleid/kernel/ps/sched.c @@ -25,23 +25,22 @@ #include #include #include -#include // // For test purpose only // int procslen = 10; Process_t procs[] = { - { 0, 0, 0, 12, 12, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 1, 2, 2, 16, 16, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 2, 3, 3, 31, 31, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 3, 2, 2, 1, 1, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 4, 3, 3, 5, 5, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 5, 0, 0, 30, 30, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 6, 1, 1, 19, 19, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 7, 1, 1, 0, 0, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 8, 3, 3, 12, 12, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, - { 9, 2, 2, 21, 21, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL, NULL, NULL }, + { 0, 0, 0, 12, 12, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 1, 2, 2, 16, 16, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 2, 3, 3, 31, 31, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 3, 2, 2, 1, 1, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 4, 3, 3, 5, 5, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 5, 0, 0, 30, 30, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 6, 1, 1, 19, 19, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 7, 1, 1, 0, 0, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 8, 3, 3, 12, 12, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, + { 9, 2, 2, 21, 21, STATE_RUNNABLE, DEF_PROC_TSLICE, DEF_PROC_TSLICE, NULL }, }; //------------------------------------------// diff --git a/kaleid/kernel/buf/bprint.c b/kaleid/libbuf/bprint.c similarity index 99% rename from kaleid/kernel/buf/bprint.c rename to kaleid/libbuf/bprint.c index 099a968..aeab335 100644 --- a/kaleid/kernel/buf/bprint.c +++ b/kaleid/libbuf/bprint.c @@ -22,7 +22,8 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include +#include error_t bputc(Buffer_t *buf, uchar ch); error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap); @@ -352,7 +353,7 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) if (*s == '-') { rc = bputc(buf, '-'); s++, len--; } else if (sgn && plus) rc = bputc(buf, '+'); else if (sgn && space) rc = bputc(buf, ' '); - else bprinthash(buf, base, cap); + else if (hash) bprinthash(buf, base, cap); // Deal with padding by zeroes // The 'minus' flag makes no sense with the 'zero' one diff --git a/kaleid/kernel/buf/bput.c b/kaleid/libbuf/bput.c similarity index 99% rename from kaleid/kernel/buf/bput.c rename to kaleid/libbuf/bput.c index 6550af4..9e685df 100644 --- a/kaleid/kernel/buf/bput.c +++ b/kaleid/libbuf/bput.c @@ -22,7 +22,8 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include +#include error_t bputc(Buffer_t *buf, uchar ch); diff --git a/kaleid/kernel/buf/buf.c b/kaleid/libbuf/buf.c similarity index 96% rename from kaleid/kernel/buf/buf.c rename to kaleid/libbuf/buf.c index 63b6c3b..858c129 100644 --- a/kaleid/kernel/buf/buf.c +++ b/kaleid/libbuf/buf.c @@ -22,7 +22,8 @@ // along with OS/K. If not, see . // //----------------------------------------------------------------------------// -#include +#include +#include #include Buffer_t *BStdOut, *BStdDbg; @@ -57,7 +58,7 @@ error_t BCloseBuf(Buffer_t *buf) } if (buf->flags & BF_ALLOC) { - free(buf->buf); + KalFreeMemory(buf->buf); } buf->buf = buf->rp = buf->wp = NULL; @@ -110,7 +111,7 @@ Buffer_t *BOpenLineBuf(char *source, int mode, buf->size = lineLen * nLines * (pbCount + 1); if (source == NULL) { - buf->buf = calloc(buf->size, 1); + KalAllocMemoryEx((void **)&buf->buf, buf->size, M_ZEROED, 0); } else { buf->buf = (uchar *)source; } diff --git a/kaleid/crtlib/atoi.c b/kaleid/libc/atoi.c similarity index 100% rename from kaleid/crtlib/atoi.c rename to kaleid/libc/atoi.c diff --git a/kaleid/crtlib/ctype.c b/kaleid/libc/ctype.c similarity index 100% rename from kaleid/crtlib/ctype.c rename to kaleid/libc/ctype.c diff --git a/kaleid/crtlib/itoa.c b/kaleid/libc/itoa.c similarity index 100% rename from kaleid/crtlib/itoa.c rename to kaleid/libc/itoa.c diff --git a/kaleid/crtlib/mem.c b/kaleid/libc/mem.c similarity index 97% rename from kaleid/crtlib/mem.c rename to kaleid/libc/mem.c index cd158e9..470afd3 100644 --- a/kaleid/crtlib/mem.c +++ b/kaleid/libc/mem.c @@ -36,7 +36,7 @@ void *malloc(size_t n) void *ptr; error_t rc; - rc = KalAllocMemory(&ptr, n, 0, 0); + rc = KalAllocMemory(&ptr, n); if (rc > 0) seterrno(rc); return ptr; @@ -44,9 +44,13 @@ void *malloc(size_t n) void *calloc(size_t n, size_t m) { - char *mem = malloc(n * m); - memzero(mem, n * m); - return mem; + void *ptr; + error_t rc; + + rc = KalAllocMemoryEx(&ptr, n * m, M_ZEROED, 0); + if (rc > 0) seterrno(rc); + + return ptr; } void free(void *ptr) diff --git a/kaleid/crtlib/rand.c b/kaleid/libc/rand.c similarity index 100% rename from kaleid/crtlib/rand.c rename to kaleid/libc/rand.c diff --git a/kaleid/crtlib/sprintf.c b/kaleid/libc/sprintf.c similarity index 96% rename from kaleid/crtlib/sprintf.c rename to kaleid/libc/sprintf.c index be93623..f7f3882 100644 --- a/kaleid/crtlib/sprintf.c +++ b/kaleid/libc/sprintf.c @@ -31,12 +31,6 @@ // // Format str according to fmt using ellipsed arguments // -// Standard is dumb so we won't follow it: -// 1) we return a size_t instead of int -// 2) for (v)snprintf we return the number of characters written -// instead of the number of characters that would have been written -// given large enough n -// size_t sprintf(char *str, const char *fmt, ...) { int ret; diff --git a/kaleid/crtlib/status.c b/kaleid/libc/status.c similarity index 100% rename from kaleid/crtlib/status.c rename to kaleid/libc/status.c diff --git a/kaleid/crtlib/string.c b/kaleid/libc/string.c similarity index 100% rename from kaleid/crtlib/string.c rename to kaleid/libc/string.c diff --git a/kaleid/crtlib/strtol.c b/kaleid/libc/strtol.c similarity index 100% rename from kaleid/crtlib/strtol.c rename to kaleid/libc/strtol.c From cfb4ae7b099263d0fe46da9baba30aa5a0d42a65 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sat, 6 Apr 2019 21:19:31 +0200 Subject: [PATCH 10/21] test --- kaleid/kernel/init/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index a0e978b..3855d3a 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -151,7 +151,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) PsInitSched(); KeStartPanic("Test Panic %x", 4); - + // End this machine's suffering KeCrashSystem(); } From 1a051fc5b4464a4c81bc713fca2b139726e5b79f Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sat, 6 Apr 2019 21:21:34 +0200 Subject: [PATCH 11/21] timeout changed --- boot/grub/grub.cfg | 2 +- kaleid/kernel/init/init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/grub/grub.cfg b/boot/grub/grub.cfg index 4efc73e..97bc428 100755 --- a/boot/grub/grub.cfg +++ b/boot/grub/grub.cfg @@ -22,7 +22,7 @@ # along with OS/K. If not, see . # #=----------------------------------------------------------------------------=# -set timeout=5 +set timeout=0 set default=0 #Set the default menu entry diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 3855d3a..d84884c 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -150,7 +150,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) MmInitHeap(); PsInitSched(); - KeStartPanic("Test Panic %x", 4); + KeStartPanic("Test Panic %d", 4); // End this machine's suffering KeCrashSystem(); From 3550fadbf9273d33ce05aa83b8f85fa99febcc72 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 14:59:18 +0200 Subject: [PATCH 12/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6f8557..b187161 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To compile this project from sources, you must first install the dependencies ``` apt update && apt upgrade -apt install grub-pc dosfstools make nasm qemu +apt install grub-pc-bin dosfstools make nasm qemu tree ``` You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) and its "bin" repertory in your PATH. From 91e5bbf83dc8462630b5ad773ae5d03385924ae3 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 15:01:33 +0200 Subject: [PATCH 13/21] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b187161..a240f4b 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ For changelog, see [ChangeLog](ChangeLog) For structure of the sources, see [ProjectTree](ProjectTree) +For our IRC channel, see #os.k-devel on [Freenode](https://webchat.freenode.net) + Note that every file within OS/K is written using spaces for tabulation, with each tabulation being 4 spaces long. -IRC Channel: #os.k-devel on Freenode - #### Compile from sources To compile this project from sources, you must first install the dependencies From 0addc2e9524ace9a2c818c23ad428bf8b57b226a Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 15:04:21 +0200 Subject: [PATCH 14/21] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a240f4b..b815425 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For changelog, see [ChangeLog](ChangeLog) For structure of the sources, see [ProjectTree](ProjectTree) -For our IRC channel, see #os.k-devel on [Freenode](https://webchat.freenode.net) +For our IRC channel, see `#os.k-devel` on [Freenode](https://webchat.freenode.net) Note that every file within OS/K is written using spaces for tabulation, with each tabulation being 4 spaces long. @@ -25,7 +25,7 @@ apt update && apt upgrade apt install grub-pc-bin dosfstools make nasm qemu tree ``` -You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) and its "bin" repertory in your PATH. +You also need to have the [x86-64 ELF gcc cross-compiler](https://www.os-k.eu/build-tools/cross-cc.tar.xz) and its ``bin`` directory in your PATH. To compile, simply use at the root of this project : ``` From ac626ae40831013ed2f028cb5b0a7072fa26e766 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 17:16:13 +0200 Subject: [PATCH 15/21] Makefile update --- Makefile | 221 +++++++++++---------------- ProjectTree | 39 +++-- build/obj/boot/.placeholder | 0 build/obj/kaleid/kernel/.placeholder | 0 kaleid/kernel/cpu/idt.c | 2 +- 5 files changed, 111 insertions(+), 151 deletions(-) delete mode 100644 build/obj/boot/.placeholder delete mode 100644 build/obj/kaleid/kernel/.placeholder diff --git a/Makefile b/Makefile index 4c19ff2..2c4a3d0 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,9 @@ # along with OS/K. If not, see . # #=----------------------------------------------------------------------------=# +.PHONY: all test test32 debug gdb install_mbr clean OS/K +all : OS/K + ## VARIABLES ----------------------------------------------------------------- # #Programs @@ -35,7 +38,7 @@ COPTIM=-O2 CWARNS=-Wall -Wextra -Werror=implicit-function-declaration CINCLUDES=-Iinclude CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 -CFLAGS2= -c -g -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fno-strict-aliasing +CFLAGS2= -c -g -mno-red-zone -mno-mmx -mno-sse -mno-sse2 CFLAGS=$(CFLAGS1) $(CFLAGS2) KCC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES) -D_OSK_SOURCE -D_KALEID_KERNEL @@ -50,19 +53,16 @@ LOBJDIR=build/obj/boot BINDIR=build/bin BUILDDIR=build +vpath %.c $(KALEIDDIR) + #Color codes CL='\033[0;32m' CL2='\033[1;36m' CL3='\033[0m' NC='\033[1;37m' -.PHONY: all -all : OS/K - -## KALEID MAKEFILE ----------------------------------------------------------- # - -# Common objects -kal_com_obj= $(KOBJDIR)/atoi.o $(KOBJDIR)/ctype.o \ +# Lib C +LibCObj= $(KOBJDIR)/atoi.o $(KOBJDIR)/ctype.o \ $(KOBJDIR)/itoa.o $(KOBJDIR)/mem.o \ $(KOBJDIR)/rand.o $(KOBJDIR)/sprintf.o \ $(KOBJDIR)/status.o $(KOBJDIR)/string.o \ @@ -72,118 +72,17 @@ kal_com_obj= $(KOBJDIR)/atoi.o $(KOBJDIR)/ctype.o \ $(KOBJDIR)/utoa.o $(KOBJDIR)/ltoa.o \ $(KOBJDIR)/ultoa.o -$(KOBJDIR)/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ATOI $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atol.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ATOL $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atou.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ATOU $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atoul.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ATOUL $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ctype.o: $(KALEIDDIR)/libc/ctype.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ITOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ltoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_LTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/utoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_UTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ultoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h - @$(KCC) -D_NEED_ULTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h - @$(KCC) -fno-strict-aliasing $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/rand.o: $(KALEIDDIR)/libc/rand.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/sprintf.o: $(KALEIDDIR)/libc/sprintf.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/status.o: $(KALEIDDIR)/libc/status.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/string.o: $(KALEIDDIR)/libc/string.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/strtol.o: $(KALEIDDIR)/libc/strtol.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} - -$(KOBJDIR)/argv.o: $(KALEIDDIR)/extras/argv.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/prog.o: $(KALEIDDIR)/extras/prog.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} - -$(KOBJDIR)/kernel/buf.o: $(KALEIDDIR)/libbuf/buf.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/bput.o: $(KALEIDDIR)/libbuf/bput.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/bprint.o: $(KALEIDDIR)/libbuf/bprint.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} - -# Kernel objects -kal_kern_obj= $(KOBJDIR)/kernel/cpuid.o $(KOBJDIR)/kernel/init.o \ - $(KOBJDIR)/kernel/table.o $(KOBJDIR)/kernel/cursor.o \ - $(KOBJDIR)/kernel/log.o $(KOBJDIR)/kernel/vga.o \ - $(KOBJDIR)/kernel/panic.o $(KOBJDIR)/kernel/map.o \ - $(KOBJDIR)/kernel/heap.o $(KOBJDIR)/kernel/malloc.o \ - $(KOBJDIR)/kernel/buf.o $(KOBJDIR)/kernel/sched.o \ - $(KOBJDIR)/kernel/bput.o $(KOBJDIR)/kernel/bprint.o \ - $(KOBJDIR)/kernel/gdt.o - -$(KOBJDIR)/kernel/cpuid.o: $(KALEIDDIR)/kernel/cpu/cpuid.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/idt.o: $(KALEIDDIR)/kernel/cpu/idt.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/init.o: $(KALEIDDIR)/kernel/init/init.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/table.o: $(KALEIDDIR)/kernel/init/table.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/cursor.o: $(KALEIDDIR)/kernel/io/cursor.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/log.o: $(KALEIDDIR)/kernel/ke/log.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/vga.o: $(KALEIDDIR)/kernel/io/vga.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/panic.o: $(KALEIDDIR)/kernel/ke/panic.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/map.o: $(KALEIDDIR)/kernel/mm/map.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/heap.o: $(KALEIDDIR)/kernel/mm/heap.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/malloc.o: $(KALEIDDIR)/kernel/mm/malloc.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ -$(KOBJDIR)/kernel/gdt.o: $(KALEIDDIR)/kernel/mm/gdt.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/kernel/sched.o: $(KALEIDDIR)/kernel/ps/sched.c $(INCLUDEDIR)/*/*.h - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} +# Kernel sources +KernSources=libbuf/buf.c libbuf/bput.c \ + libbuf/bprint.c kernel/cpu/cpuid.c \ + kernel/cpu/idt.c kernel/init/init.c \ + kernel/init/table.c kernel/io/cursor.c \ + kernel/ke/log.c kernel/io/vga.c \ + kernel/ke/panic.c kernel/mm/map.c \ + kernel/mm/heap.c kernel/mm/malloc.c \ + kernel/mm/gdt.c kernel/ps/sched.c \ +KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) ## MISC MAKEFILE ------------------------------------------------------------- # ./ProjectTree: ./.stylehlp_sh @@ -192,24 +91,83 @@ $(KOBJDIR)/kernel/sched.o: $(KALEIDDIR)/kernel/ps/sched.c $(INCLUDEDIR)/*/*.h @tree --dirsfirst >> ./ProjectTree @echo ${CL2}[$@] ${CL}Generated.${CL3} +$(KOBJDIR): + @mkdir -p $(KOBJDIR) + +## Lib C MAKEFILE ------------------------------------------------------------ # +$(KOBJDIR)/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ATOI $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/atol.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ATOL $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/atou.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ATOU $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/atoul.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ATOUL $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ITOA $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/ltoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_LTOA $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/utoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_UTOA $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/ultoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -D_NEED_ULTOA $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) -fno-strict-aliasing $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/ctype.o: $(KALEIDDIR)/libc/ctype.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/rand.o: $(KALEIDDIR)/libc/rand.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/sprintf.o: $(KALEIDDIR)/libc/sprintf.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/status.o: $(KALEIDDIR)/libc/status.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/string.o: $(KALEIDDIR)/libc/string.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/strtol.o: $(KALEIDDIR)/libc/strtol.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/argv.o: $(KALEIDDIR)/extras/argv.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} +$(KOBJDIR)/prog.o: $(KALEIDDIR)/extras/prog.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} + +## KERNEL MAKEFILE ----------------------------------------------------------- # +$(KOBJDIR)/%.o: %.c $(INCLUDEDIR)/*/*.h + @mkdir -p $(shell dirname $@) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} + ## MAIN MAKEFILE ------------------------------------------------------------- # -.PHONY: test test: all @qemu-system-x86_64 -m 4G -hda $(BUILDDIR)/bin/disk.img \ -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & -.PHONY: test32 + test32: all @qemu-system-i386 -hda $(BUILDDIR)/bin/disk.img -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & -.PHONY: debug debug: all @qemu-system-x86_64 -m 64M -hda $(BUILDDIR)/bin/disk.img -no-reboot \ -no-shutdown -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > $(BUILDDIR)/kaleid64_disasm.asm @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > $(BUILDDIR)/kaleid32_disasm.asm -.PHONY: gdb gdb: all @qemu-system-x86_64 -m 64M -hda $(BUILDDIR)/bin/disk.img -no-reboot \ -no-shutdown -d cpu_reset,guest_errors,pcall,int -s 2> $(BUILDDIR)/qemu.log & @@ -221,7 +179,6 @@ gdb: all -ex "symbol-file $(BINDIR)/kaleid" \ -ex "break BtStartKern" \ -.PHONY: install_mbr install_mbr: $(BINDIR)/disk.img $(MBRDIR)/grub.cfg @mkdir -p $(BINDIR)/disk @echo ${CL2}[$@] ${NC}Installing MBR on image...${CL3} @@ -230,12 +187,10 @@ install_mbr: $(BINDIR)/disk.img $(MBRDIR)/grub.cfg @rmdir $(BINDIR)/disk @echo ${CL2}[$@] ${CL}Success.${CL3} -.PHONY: clean clean: -@$(MBRDIR)/umount.sh $(BINDIR)/disk || /bin/true - @rm -Rvf ./ProjectTree - @rm -Rvf $(BINDIR)/* $(OBJDIR)/*.o \ - $(OBJDIR)/*/*.o $(OBJDIR)/*/*.x86_64 $(OBJDIR)/*/*/*.o + @rm -Rvf ./ProjectTree $(BUILDDIR)/*.log + @rm -Rvf $(BINDIR)/* $(KernObj) $(LibCObj) $(OBJDIR)/* @echo ${CL2}[[$@]] ${CL}Cleaned.${CL3} $(BINDIR)/kaleid: $(LOBJDIR)/kaleid.x86_64 @@ -243,17 +198,16 @@ $(BINDIR)/kaleid: $(LOBJDIR)/kaleid.x86_64 @x86_64-elf-objcopy -I elf64-x86-64 -O elf32-i386 $(LOBJDIR)/kaleid.x86_64 $(BINDIR)/kaleid @echo ${CL2}[$@] ${CL}Success.${CL3} -$(LOBJDIR)/kaleid.x86_64: $(kal_kern_obj) $(kal_com_obj) $(LOBJDIR)/loader.o +$(LOBJDIR)/kaleid.x86_64: $(LibCObj) $(KernObj) $(LOBJDIR)/loader.o @echo ${CL2}[$@] ${NC}Linking kernel objects...${CL3} - @$(LD) $(LDFLAGS) -T $(BUILDDIR)/kernel.ld \ - $(LOBJDIR)/loader.o \ - $(KOBJDIR)/*.o \ - $(KOBJDIR)/kernel/*.o \ + @$(LD) $(LDFLAGS) -T $(BUILDDIR)/kernel.ld \ + $(LOBJDIR)/loader.o $(KernObj) $(LibCObj) \ -o $(LOBJDIR)/kaleid.x86_64 @echo ${CL2}[$@] ${CL}Success.${CL3} $(LOBJDIR)/loader.o: $(LOADERDIR)/loader.asm $(LOADERDIR)/*/*.inc @echo ${CL2}[$@] ${NC}Making loader...${CL3} + @mkdir -p $(shell dirname $@) @$(ASM) $(ASMFLAGS) $(LOADERDIR)/loader.asm -o $(LOBJDIR)/loader.o > /dev/null @echo ${CL2}[$@] ${CL}Success.${CL3} @@ -264,7 +218,6 @@ $(BINDIR)/disk.img: $(MBRDIR)/create_disk.sh @make install_mbr @echo ${CL2}[$@]${NC} Constructing disk image...${CL3} -.PHONY:OS/K OS/K: $(BINDIR)/kaleid $(BINDIR)/disk.img ./ProjectTree @mkdir -p $(BINDIR)/disk @echo ${CL2}[[$@]] ${NC}Integrating kernel...${CL3} diff --git a/ProjectTree b/ProjectTree index 41c126d..a8b117d 100644 --- a/ProjectTree +++ b/ProjectTree @@ -56,21 +56,29 @@ │   │   │   └── loader.o │   │   └── kaleid │   │   ├── kernel +│   │   │   ├── cpu +│   │   │   │   ├── cpuid.o +│   │   │   │   └── idt.o +│   │   │   ├── init +│   │   │   │   ├── init.o +│   │   │   │   └── table.o +│   │   │   ├── io +│   │   │   │   ├── cursor.o +│   │   │   │   └── vga.o +│   │   │   ├── ke +│   │   │   │   ├── log.o +│   │   │   │   └── panic.o +│   │   │   ├── mm +│   │   │   │   ├── gdt.o +│   │   │   │   ├── heap.o +│   │   │   │   ├── malloc.o +│   │   │   │   └── map.o +│   │   │   └── ps +│   │   │   └── sched.o +│   │   ├── libbuf │   │   │   ├── bprint.o │   │   │   ├── bput.o -│   │   │   ├── buf.o -│   │   │   ├── cpuid.o -│   │   │   ├── cursor.o -│   │   │   ├── gdt.o -│   │   │   ├── heap.o -│   │   │   ├── init.o -│   │   │   ├── log.o -│   │   │   ├── malloc.o -│   │   │   ├── map.o -│   │   │   ├── panic.o -│   │   │   ├── sched.o -│   │   │   ├── table.o -│   │   │   └── vga.o +│   │   │   └── buf.o │   │   ├── argv.o │   │   ├── atoi.o │   │   ├── atol.o @@ -89,8 +97,7 @@ │   │   ├── ultoa.o │   │   └── utoa.o │   ├── grub.log -│   ├── kernel.ld -│   └── qemu.log +│   └── kernel.ld ├── include │   ├── base │   │   ├── assert.h @@ -167,4 +174,4 @@ ├── ProjectTree └── README.md -28 directories, 114 files +35 directories, 114 files diff --git a/build/obj/boot/.placeholder b/build/obj/boot/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/build/obj/kaleid/kernel/.placeholder b/build/obj/kaleid/kernel/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/kaleid/kernel/cpu/idt.c b/kaleid/kernel/cpu/idt.c index 469796c..cdcf44c 100644 --- a/kaleid/kernel/cpu/idt.c +++ b/kaleid/kernel/cpu/idt.c @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // // along with OS/K. If not, see . // //----------------------------------------------------------------------------// - +#include // // Registers the new idt in the idtr register. From 0b95ba91f201589251e105245741911f07bae846 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 23:35:31 +0200 Subject: [PATCH 16/21] Makefile big enhancement --- Makefile | 153 ++++++++++++++++++-------------------- ProjectTree | 40 +++++----- kaleid/kernel/init/init.c | 2 + 3 files changed, 95 insertions(+), 100 deletions(-) diff --git a/Makefile b/Makefile index 2c4a3d0..9be191e 100644 --- a/Makefile +++ b/Makefile @@ -23,26 +23,36 @@ #=----------------------------------------------------------------------------=# .PHONY: all test test32 debug gdb install_mbr clean OS/K -all : OS/K ## VARIABLES ----------------------------------------------------------------- # -#Programs +# Debug +mode ?= debug + +# Programs ASM=nasm LD=ld CCNAME=x86_64-elf-gcc - ASMFLAGS=-f elf64 LDFLAGS=-melf_x86_64 COPTIM=-O2 CWARNS=-Wall -Wextra -Werror=implicit-function-declaration CINCLUDES=-Iinclude CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11 -CFLAGS2= -c -g -mno-red-zone -mno-mmx -mno-sse -mno-sse2 +CFLAGS2= -c -mno-red-zone -mno-mmx -mno-sse -mno-sse2 CFLAGS=$(CFLAGS1) $(CFLAGS2) + +ifeq ($(mode), release) +CFLAGS += -D_NO_DEBUG +dep += dust +endif +ifeq ($(mode), debug) +CFLAGS += -g +endif + KCC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES) -D_OSK_SOURCE -D_KALEID_KERNEL -#Folders +# Folders MBRDIR=boot/grub LOADERDIR=boot/loader KALEIDDIR=kaleid @@ -52,37 +62,42 @@ KOBJDIR=build/obj/kaleid LOBJDIR=build/obj/boot BINDIR=build/bin BUILDDIR=build - vpath %.c $(KALEIDDIR) -#Color codes +# Color codes CL='\033[0;32m' CL2='\033[1;36m' CL3='\033[0m' NC='\033[1;37m' -# Lib C -LibCObj= $(KOBJDIR)/atoi.o $(KOBJDIR)/ctype.o \ - $(KOBJDIR)/itoa.o $(KOBJDIR)/mem.o \ - $(KOBJDIR)/rand.o $(KOBJDIR)/sprintf.o \ - $(KOBJDIR)/status.o $(KOBJDIR)/string.o \ - $(KOBJDIR)/strtol.o $(KOBJDIR)/argv.o \ - $(KOBJDIR)/prog.o $(KOBJDIR)/atol.o \ - $(KOBJDIR)/atou.o $(KOBJDIR)/atoul.o \ - $(KOBJDIR)/utoa.o $(KOBJDIR)/ltoa.o \ - $(KOBJDIR)/ultoa.o + +## SOURCES INSCRIPTION-------------------------------------------------------- # + +# Lib C sources +LibCSources= libc/atoi.c libc/itoa.c \ + libc/mem.c libc/ctype.c \ + libc/rand.c libc/sprintf.c \ + libc/status.c libc/string.c \ + libc/strtol.c extras/argv.c \ + extras/prog.c # Kernel sources -KernSources=libbuf/buf.c libbuf/bput.c \ - libbuf/bprint.c kernel/cpu/cpuid.c \ - kernel/cpu/idt.c kernel/init/init.c \ - kernel/init/table.c kernel/io/cursor.c \ - kernel/ke/log.c kernel/io/vga.c \ - kernel/ke/panic.c kernel/mm/map.c \ - kernel/mm/heap.c kernel/mm/malloc.c \ - kernel/mm/gdt.c kernel/ps/sched.c \ +KernSources= libbuf/buf.c libbuf/bput.c \ + libbuf/bprint.c kernel/cpu/cpuid.c \ + kernel/cpu/idt.c kernel/init/init.c \ + kernel/init/table.c kernel/io/cursor.c \ + kernel/ke/log.c kernel/io/vga.c \ + kernel/ke/panic.c kernel/mm/map.c \ + kernel/mm/heap.c kernel/mm/malloc.c \ + kernel/mm/gdt.c kernel/ps/sched.c \ KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) +LibCObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(LibCSources)) + + +## KALEID MAKEFILE ----------------------------------------------------------- # + +all : OS/K $(dep) ## MISC MAKEFILE ------------------------------------------------------------- # ./ProjectTree: ./.stylehlp_sh @@ -94,67 +109,37 @@ KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) $(KOBJDIR): @mkdir -p $(KOBJDIR) -## Lib C MAKEFILE ------------------------------------------------------------ # -$(KOBJDIR)/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ATOI $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atol.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ATOL $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atou.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ATOU $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/atoul.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ATOUL $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ITOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ltoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_LTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/utoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_UTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ultoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -D_NEED_ULTOA $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) -fno-strict-aliasing $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/ctype.o: $(KALEIDDIR)/libc/ctype.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/rand.o: $(KALEIDDIR)/libc/rand.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/sprintf.o: $(KALEIDDIR)/libc/sprintf.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/status.o: $(KALEIDDIR)/libc/status.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/string.o: $(KALEIDDIR)/libc/string.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/strtol.o: $(KALEIDDIR)/libc/strtol.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/argv.o: $(KALEIDDIR)/extras/argv.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ - @echo ${CL2}[$@] ${CL}Compiled.${CL3} -$(KOBJDIR)/prog.o: $(KALEIDDIR)/extras/prog.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) - @$(KCC) $< -o $@ +## LIB C MAKEFILE ------------------------------------------------------------ # +$(KOBJDIR)/libc/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @mkdir -p $(shell dirname $@) + @$(KCC) -D_NEED_ATOI $< -o $@.1 + @$(KCC) -D_NEED_ATOL $< -o $@.2 + @$(KCC) -D_NEED_ATOU $< -o $@.3 + @$(KCC) -D_NEED_ATOUL $< -o $@.4 + @$(LD) -r $@.1 $@.2 $@.3 $@.4 -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} -## KERNEL MAKEFILE ----------------------------------------------------------- # -$(KOBJDIR)/%.o: %.c $(INCLUDEDIR)/*/*.h +$(KOBJDIR)/libc/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) @mkdir -p $(shell dirname $@) - @$(KCC) $< -o $@ + @$(KCC) -D_NEED_ITOA $< -o $@.1 + @$(KCC) -D_NEED_LTOA $< -o $@.2 + @$(KCC) -D_NEED_UTOA $< -o $@.3 + @$(KCC) -D_NEED_ULTOA $< -o $@.4 + @$(LD) -r $@.1 $@.2 $@.3 $@.4 -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} + +$(KOBJDIR)/libc/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @mkdir -p $(shell dirname $@) + @$(KCC) -fno-strict-aliasing $< -o $@ @echo ${CL2}[$@] ${CL}Compiled.${CL3} ## MAIN MAKEFILE ------------------------------------------------------------- # +$(KOBJDIR)/%.o: %.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) + @mkdir -p $(shell dirname $@) + @$(KCC) $< -o $@ + @echo ${CL2}[$@] ${CL}Compiled.${CL3} + test: all @qemu-system-x86_64 -m 4G -hda $(BUILDDIR)/bin/disk.img \ -d cpu_reset,guest_errors,pcall,int 2> $(BUILDDIR)/qemu.log & @@ -187,11 +172,15 @@ install_mbr: $(BINDIR)/disk.img $(MBRDIR)/grub.cfg @rmdir $(BINDIR)/disk @echo ${CL2}[$@] ${CL}Success.${CL3} +dust: + -@$(MBRDIR)/umount.sh $(BINDIR)/disk || /bin/true + @rm -Rf $(OBJDIR)/* + @echo ${CL2}[$@] ${CL}Cleaned.${CL3} clean: -@$(MBRDIR)/umount.sh $(BINDIR)/disk || /bin/true @rm -Rvf ./ProjectTree $(BUILDDIR)/*.log - @rm -Rvf $(BINDIR)/* $(KernObj) $(LibCObj) $(OBJDIR)/* - @echo ${CL2}[[$@]] ${CL}Cleaned.${CL3} + @rm -Rvf $(BINDIR)/* $(OBJDIR)/* + @echo ${CL2}[$@] ${CL}Cleaned.${CL3} $(BINDIR)/kaleid: $(LOBJDIR)/kaleid.x86_64 @echo ${CL2}[$@] ${NC}Objcopy...${CL3} @@ -220,7 +209,7 @@ $(BINDIR)/disk.img: $(MBRDIR)/create_disk.sh OS/K: $(BINDIR)/kaleid $(BINDIR)/disk.img ./ProjectTree @mkdir -p $(BINDIR)/disk - @echo ${CL2}[[$@]] ${NC}Integrating kernel...${CL3} + @echo ${CL2}[[$@]] ${NC}Integrating kernel, $(mode) mode.${CL3} -@$(MBRDIR)/umount.sh $(BINDIR)/disk || /bin/true @$(MBRDIR)/mount.sh $(BINDIR)/disk.img $(BINDIR)/disk @cp $(BINDIR)/kaleid $(BINDIR)/disk/boot/kaleid diff --git a/ProjectTree b/ProjectTree index a8b117d..bb8d75a 100644 --- a/ProjectTree +++ b/ProjectTree @@ -55,6 +55,9 @@ │   │   │   ├── kaleid.x86_64 │   │   │   └── loader.o │   │   └── kaleid +│   │   ├── extras +│   │   │   ├── argv.o +│   │   │   └── prog.o │   │   ├── kernel │   │   │   ├── cpu │   │   │   │   ├── cpuid.o @@ -79,23 +82,24 @@ │   │   │   ├── bprint.o │   │   │   ├── bput.o │   │   │   └── buf.o -│   │   ├── argv.o -│   │   ├── atoi.o -│   │   ├── atol.o -│   │   ├── atoul.o -│   │   ├── atou.o -│   │   ├── ctype.o -│   │   ├── itoa.o -│   │   ├── ltoa.o -│   │   ├── mem.o -│   │   ├── prog.o -│   │   ├── rand.o -│   │   ├── sprintf.o -│   │   ├── status.o -│   │   ├── string.o -│   │   ├── strtol.o -│   │   ├── ultoa.o -│   │   └── utoa.o +│   │   └── libc +│   │   ├── atoi.o +│   │   ├── atoi.o.1 +│   │   ├── atoi.o.2 +│   │   ├── atoi.o.3 +│   │   ├── atoi.o.4 +│   │   ├── ctype.o +│   │   ├── itoa.o +│   │   ├── itoa.o.1 +│   │   ├── itoa.o.2 +│   │   ├── itoa.o.3 +│   │   ├── itoa.o.4 +│   │   ├── mem.o +│   │   ├── rand.o +│   │   ├── sprintf.o +│   │   ├── status.o +│   │   ├── string.o +│   │   └── strtol.o │   ├── grub.log │   └── kernel.ld ├── include @@ -174,4 +178,4 @@ ├── ProjectTree └── README.md -35 directories, 114 files +37 directories, 116 files diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index d84884c..115dc09 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -150,6 +150,8 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) MmInitHeap(); PsInitSched(); + KalAssert(0); + KeStartPanic("Test Panic %d", 4); // End this machine's suffering From 6e38478e144787f033d63392097e1d27030bad7c Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 23:36:30 +0200 Subject: [PATCH 17/21] Makefile big enhancement --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9be191e..b1518b6 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,8 @@ LibCSources= libc/atoi.c libc/itoa.c \ libc/strtol.c extras/argv.c \ extras/prog.c +KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) + # Kernel sources KernSources= libbuf/buf.c libbuf/bput.c \ libbuf/bprint.c kernel/cpu/cpuid.c \ @@ -91,7 +93,6 @@ KernSources= libbuf/buf.c libbuf/bput.c \ kernel/mm/heap.c kernel/mm/malloc.c \ kernel/mm/gdt.c kernel/ps/sched.c \ -KernObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(KernSources)) LibCObj=$(patsubst %.c,$(KOBJDIR)/%.o,$(LibCSources)) From 7167d958f70f2a0750be9e74daec2987016ec9ac Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Tue, 9 Apr 2019 23:40:57 +0200 Subject: [PATCH 18/21] Update ChangeLog --- ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7cb68d1..c5582fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,4 +40,8 @@ - We have implemented a buffer library for our terminal - The stack is now 8MB long and isn't anymore in conflict with the kernel space xD - The terminal is now better (with sprintf functions) - +2019/04/09 More improvements + - The terminal is now buffered (static) and we have made a big reorganization of the project + - The Makefile suffered a lot, so we improved it + - panic doesn't need to lock the terminal + - We have a (basic) heap and memory allocator From 3f5e36599f0c4f5d28b2be95c91902dee385137d Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 10 Apr 2019 10:55:22 +0200 Subject: [PATCH 19/21] Makefile Update --- Makefile | 7 ++++--- kaleid/kernel/init/init.c | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b1518b6..4e9a9fc 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ # along with OS/K. If not, see . # #=----------------------------------------------------------------------------=# -.PHONY: all test test32 debug gdb install_mbr clean OS/K +.PHONY: all test test32 debug gdb install_mbr dust clean OS/K ## VARIABLES ----------------------------------------------------------------- # @@ -31,7 +31,8 @@ mode ?= debug # Programs ASM=nasm -LD=ld +LD=x86_64-elf-ld +OBJCOPY=x86_64-elf-objcopy CCNAME=x86_64-elf-gcc ASMFLAGS=-f elf64 LDFLAGS=-melf_x86_64 @@ -185,7 +186,7 @@ clean: $(BINDIR)/kaleid: $(LOBJDIR)/kaleid.x86_64 @echo ${CL2}[$@] ${NC}Objcopy...${CL3} - @x86_64-elf-objcopy -I elf64-x86-64 -O elf32-i386 $(LOBJDIR)/kaleid.x86_64 $(BINDIR)/kaleid + @$(OBJCOPY) -I elf64-x86-64 -O elf32-i386 $(LOBJDIR)/kaleid.x86_64 $(BINDIR)/kaleid @echo ${CL2}[$@] ${CL}Success.${CL3} $(LOBJDIR)/kaleid.x86_64: $(LibCObj) $(KernObj) $(LOBJDIR)/loader.o diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 115dc09..96b4c63 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -150,9 +150,7 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic) MmInitHeap(); PsInitSched(); - KalAssert(0); - - KeStartPanic("Test Panic %d", 4); + //KeStartPanic("Test Panic %d", 4); // End this machine's suffering KeCrashSystem(); From 2690e90e81a9ef4b4afdd78d4b99fcd42048fd22 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 10 Apr 2019 10:55:47 +0200 Subject: [PATCH 20/21] Makefile Update --- build/obj/kaleid/libc/atoi.o.1 | Bin 0 -> 3776 bytes build/obj/kaleid/libc/atoi.o.2 | Bin 0 -> 3752 bytes build/obj/kaleid/libc/atoi.o.3 | Bin 0 -> 3776 bytes build/obj/kaleid/libc/atoi.o.4 | Bin 0 -> 3800 bytes build/obj/kaleid/libc/itoa.o.1 | Bin 0 -> 5752 bytes build/obj/kaleid/libc/itoa.o.2 | Bin 0 -> 5656 bytes build/obj/kaleid/libc/itoa.o.3 | Bin 0 -> 4528 bytes build/obj/kaleid/libc/itoa.o.4 | Bin 0 -> 4520 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 build/obj/kaleid/libc/atoi.o.1 create mode 100644 build/obj/kaleid/libc/atoi.o.2 create mode 100644 build/obj/kaleid/libc/atoi.o.3 create mode 100644 build/obj/kaleid/libc/atoi.o.4 create mode 100644 build/obj/kaleid/libc/itoa.o.1 create mode 100644 build/obj/kaleid/libc/itoa.o.2 create mode 100644 build/obj/kaleid/libc/itoa.o.3 create mode 100644 build/obj/kaleid/libc/itoa.o.4 diff --git a/build/obj/kaleid/libc/atoi.o.1 b/build/obj/kaleid/libc/atoi.o.1 new file mode 100644 index 0000000000000000000000000000000000000000..ae12bfdab70d1e51bd5ea33d4c4c4d61376fe305 GIT binary patch literal 3776 zcmbVOO>7%g5T3W2AE&Mzr)gr9eo*0&Ho50{k$tB`+Fr5q85ktX%#hGk0_DpOx!kzy0gV<)1P??#CSUOP%cn9BKKQRW9mSDJnQDC@?&b(aA7aH-VfRA z0z&9;54ibb*~hXc$8j$i$Au3nb#h!GHnbnp3?J@!9iMz0o5+;a@yR4`dh+BrC0?BP zY-y4rMh3ynBq<#%wgY2X#lE%_X98g7l}ifOH-}NV4=yQiCO%n0I6sQ(qXmr~1Y(6U zP+32pR5YC>4>TH5uqL8x@c`g9eZ}@3djKWJXy)zoaEa;xEHsciK<7iLfAcwfnuCmc ztj>CE-KtmGt!fQgey!cD>q^y&G=LWet#Xadczo_{9hI9@vKGeZn#j0G$s#bXJFQMR zdoZyM!ysIbVST+uVQ}Kvwc_&JT=8i6q4I38)TwoXx^B<6y|AHC^@CEV>!tI7&swLm znZQxR2nr7(6nA|+-_X7eTQyX@u-2U4eB?;!$l+qCQ7k=&K2cnsZ}?rTR@&GIwT@!X zuebaLbp5E+@O8adYkDEH1HV!1L39bCW)Q~Pp)TR6&8hHqY>P9Q?o3CnNfl$GOr~(9 z8FX~T*TH6GH4NU;wK%E-QR!^rOK!%$9(1d14e2H06^ny5z=`GMW5pTV(?iLI;?D2J zACWr$0;tV`n%X&>`50ds;romQz?_RG@`cm+?dOHfhG7Vfp}%gYF_GQAla29VNX7t!FW-$Y&58i*hE~JKRD$0dyO4|}$$ZaVp$%WCBwk5iNL&YLm$*$Bs z$X%n%y-Agh;R9n1gS>pY9!;D|Fa8^P3mi%%ezqb4bIL|kXlbYV=pHu$n(|*hHm-}4c zd{TEW>-SptORV4bKe(JF%9Fl*a*il0z0TLH^{@&>7RWd459R1wC-$nyaYz~76e-kg zuN>>m7|L}o_MlviA}AZQu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Ro-QN}1>7MCse@NQ?N6!s{Al(Qd}f3n z<+J}A3qCdsU2yOGbvuoT>2oa-R#&i35UIVl7UhKmHgVEjT}l*8)Ec`i+ zziQz>u)bm8Ke4`L;kQ_S-NJ9M{*Hx@ab8?hhNRv94_{^b$ikms{E~&U+N)dQ z%S2wc?1wncw~UjT?(;7x`}DN`ZrRK8EpR-^OaD?5%~|+stjlv2d%@Flm45pq54orB z`KHN|%x4-eF-}+-he~v@6T3C!xT6eji4}!!mgVv#?!V=mJs{cIK{{{~g)lYM3*T0UK9TOpl82p)(6xp_PPa7liGo1IS zlrM?4?Yjdovg@+{A}J}d{olf~LG@qfLdBozr#)=fA0uYRLEcq45*(z!o^?uGAK92{*Lpv_@Yz?eG}OJ^i1t{4Hx;bKCzvRqQBX literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/atoi.o.3 b/build/obj/kaleid/libc/atoi.o.3 new file mode 100644 index 0000000000000000000000000000000000000000..da6d5714b0e8bda93a1d44e000c7e4fbed5ec0d3 GIT binary patch literal 3776 zcmbVO&yN#z6o22DUAE9|x66X=iqVn?NTltq5jYD`AXU<#J6{F$4(J@@bO4LQGeYx&CWx!-nTlo5mF zOuTV97d|5ba!2JzbJQlooH1gqk@vic%o#C=lVdh&j#w+1G)~TdBO{}oAYtDNi)c6c z5q@36&n8I2-oA>8$*1;_fshoWz8k}eH^)f?Y9EP2TSC8y>O~aukxoz~S9P-A)(jdJ z)QbDJS}Ca0YPO)>P_qEV+%`Pm#wH3Vmna;O`!lFXwW~OlcZ)lUlWOZ&>0vZ|0`mDI z2%*74;1&<(pUa<^!n}#Mn(*WaFFDtBX4!sJWURK~tf4PWoaRTe3f+ltYu~HQ% zZBR@zn$FTMJT#I zo%4L%Y1aHsy#bw|;rE)lR`+5J;3Z+F+MpRv&VQieYMW9vq6AG-880a<0^_<*sh6GY z7+6P97_BC-y4oN&IR4s7d1-F0e6adVb+%mTHo9R``}4jRwKS?hSc!DAav=;@>vq>u zIF1=X;c0}DUZCe&I?z$4fvOiZ+Vks&4pa{8FIQUS%IjzoC(Zd*(8Fw%wY5m=IPrpJ zCul)0h&!!7H_MH-7l9uJt#Tithahf;QDQ+!l!QGWdUT$-q#9q#27eRr{;&g>f}mp$ zYVEMAYk>~eYbT@decednS{PT(rA3k1pu}d_tNR+VrNi;1rNiYX@lyAuHww60Qc@RA zfm$!A9phuUFYrer{82tLbMa!abh@~4UijEBbipLs=R z*rL3b4w1+{d#kvT4N07@SU+gtr#Su*3;&7rB@4gB`bi7F%lcauex3C*7Cz2-aZ?$R zI{#taxA0?ZA6xh##xGeos~~+#e3{4}Ec-_|&X0_fn!V>gGWOYNm%hbbp63$Ble{mm zE_npM$#EaE>;;!uBKz#qCvzluISjnZf{m9Mr=GHXK{Y<#O}sjC9CE|kB1PKws)=4t zpxX2j532PzhN?lEy54K8c7nAK&y4KV>yiFYG(T)?u=FA?Xz7jKekagkPcI?WM%e9Y z+@Wa--CkXbysiug*Z-ibjE;0Ca-R}sfdzTK1eg02eFqBk{4(Vs=b~;1|w+j+6}9wjrJk%YT;>$(&Js`WLnHe~cK#lsZu~w1)@kjFnJS;h&-P zF#k`eD5R|^>wk-%@Ne;iWNx=__YM2obxHkVcnyVN{mY+Twtspn5P!jk<)+v-Ie(iA pr9SAL!1kx#)PD95f?1yb?WAN#`WA?Omtp?X{HJ|g44K>h{{sV`F+>0W literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/atoi.o.4 b/build/obj/kaleid/libc/atoi.o.4 new file mode 100644 index 0000000000000000000000000000000000000000..7ae10191e3833f8b832b2929c80ec93e4d9224bf GIT binary patch literal 3800 zcmb_e&2Jl35P#2`4<~jUCn+ITKr&xR3wUiql|mtDlmKZY3IR0-;NY(97u&?%jds_N z=1`*CS}q{90t6CBoGLC{KuG)pa6zaCgv5ov0I33T;ZSDY&N%B=_ktM7o|)g9?;Sty zdoRBHQbJ0>B*lt2))*Dy*Rf-HRg0_QgqRWKTjjscf5&Hcet#UChqRj1VbXlWJj(*` zgiNBAkRzHUMv+-sUc3M-F%&~iRuD;QB#|7}R-|QhMgoV1hFfk(VGh>7ZukhkK8MeU zh~nM44vJ1K?Ta8Xac%OmEEGQ$guakAib&&LyAJAA6nzzfh^{F-LV6g?(sJASQ*Ni_ zMOjMA*JMeEiR6QDKpkdgL7t54q0w)JoRW`aW>QvWJ~Jh!N3-{X>7yc*S^)?QW`&hG zn|dy_IRir_9LgS+a&txkHu4a}8a>^!I+uGs2aVbCTrP54%x%tK;MKX0)^g}EHY}`U z6fyzH#=)0VXyxjWgo19Y<;q~0zIG%Co=)xdU;{4a@T3AR=wD6RcoT< z*4o{=Dps993E_lZ%dX*GhnM$MU^g*k%@4sel3_4W5fIlZNSVk&VCDOsUkOE}QbRYf z@yd37yHD-hA8^F8G!fiIvZFb zcF8gb+&aExVkqJheL5>v?`OzJ#4Q1ria}V(bZibhQ?z8c&xO_{+C#V@^-|&08WGMr zo`vyoz*$C1{$D^GKb&g{4}lo}EmFmO#2J4A69K_}rwP^GPZ;D=5v=3Hr&@~P80%Bg z&lva{6o19QzbAd&z<(iq%fSC4ecQnQAiZkfH%V_9_#D-cS5HM9ClyxCQH6*J9en{Lt)pQ&=Gbu2!yTCx~g^? zm6p5X!I_qwYSmZou-5i!eU^^zxDD0s-EO&x?eW#bu6dn~f-5*mp_-K)-|4{L-Ty&( z2!gZXd2-BE5_q1BoBBK);9J=$8xTKF0pYDe6aL;Y5APY{3xu0D@s{?w`wL^l3EwL) z=705H0$(#G#^?ODacHQb47P*%zeN4-(NbamxTj|SYk-+C0TNdT{1KHHnYLJ`iJ|!h z<$X5hi=t_JX#j?HhvZ*EB}S(ITW~h0|DUN*_Q(G5em46L0W)I)B)+EnyQsv-wDsU@ zP=5Z4-f60c#P5*xZ)iE$O literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/itoa.o.1 b/build/obj/kaleid/libc/itoa.o.1 new file mode 100644 index 0000000000000000000000000000000000000000..e00fc7db6c58e84b042ae80ffc8635561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j96Ap}KE*{Ba-uPWn3@9`g)Rk@tN32gLu)!(*OZl>c8I z9`jV_6L81JkA-YPQ5^3t&$Eko6j*YV;&=G?GV!1D@oy79;o-Lshhl+vuKNJ#kNJ4+ z?-O_7bszsrs!_fR?|r`*V+g;47)C9&GV#AS{CwQ9+P+?Yk*uGqHnK|~8>THwj7+_f zO*Zu9hDheKjjTv6)$1Z@)=)wBR5ArBI_34HW^u7>6l&mV;q1~9{93YBspUF6vu4&P z>X^)pu9OX({UNzX=4#cd4!>=-lU`aZnAxgM>-c{K_5*w5?J4FQ#|I4l?%JB$Z`KC^ z;E^0>g5)xN_|l~B0Eu<@UF#?Q)5QCK@%UVkn!sC$H2naaRM+xfaSA{3I<5`-gkv@81k?{+vLGSLkr_cLg~de&59a z4*f1u-S5-)200x5_*wvmetT%5{5ymk4uAX^;DXj4rx%;!asB*F#yos}Rsj2RqWy8I z|6No(!|#j#KP#wyhU#-2tdCpb@Bd}sFelFwpfzrjW64*LRhHiY@1XcaTr3Q%>m3}& z@~2=#Oxx|aE>nEkVQj$jXZl9~g4SOOSU*x6&wUB1jk&K-{g-H>eZb+Z&>xRCPC9CU e-0>AU|9l5$3$L4XyhjDaU!?iJ#*QTY@&5(f1PY1( literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/itoa.o.2 b/build/obj/kaleid/libc/itoa.o.2 new file mode 100644 index 0000000000000000000000000000000000000000..a49d01166b6b0e58bc285f433fb6cb7c8fc76271 GIT binary patch literal 5656 zcmbtYU2Ggz6+U-nldQeTt{u0EO_01;h7#zme-g*}kK-iuBn`xFY(-53_Ih``yXpRf z+1=KO5UpZ@*n%lg5KRHuq7Q9ViH9OV`v6o#N>ib#fP{#UP$~pMC=WnWsR2aHId{&P z9gjCJaHE~`o$vhId(XXh<~mOvJ@JsC6i8EW02-RG05{qictpbyxF7BV>+;GetA59- z-@Z^-_*ZK!YrW2nPg%R)iGA^_s97J}IP^LtwbJid^_#cW$GX9)|IWH%eQ@{4;^^tc z4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Z6w^pYHkf^Ks^h^Yf6bTqssk zvnZ>MD|3PzyO2s&?fEJsGpT9{lCzZxB%LxT@0pS zMJtrkt2|Rqs+6@UStGiTFWKUc$sw687mGH2-CQR-H$CU1iZ;*V{}pjeK(+JNlyZ*H z1Dm{eU9C}X(YGQ9;cr9;mYw|KvsmAZlKPRehJPUH_Az`CAN=CUxp2K2PxAG*2T`G% z|7-jJ#!}8f{P~;oFYjZqN&h10{U}&`NbY9xe83n`b={iPZ-(nP!xN+W(HaHoH-TI* zCsOb-Z*F<75JxTOJKcmMzvsB$AsU>o1>?(T3v%TCHh%==J0vNBzUR=;Z2oV=+z5%M z`O`ZmIR6FYf;lPjKivQKN%6IyFa0-Dv;P0i{mVY3{%J{q{Xc^o<&<$E)a`k8%mq3W zRpj&N-7Maq$zr2^{Y~OTzJx}?yxg8^C&ybJ;{qAK&@UipHvcfcSpD-SO5%lY);Hyz v;r^fFfp#EAx58jN-8gxxA!@Wce5;l_xL9P~qSHO9S$v$w|Ef5$495Q#f#?G9 literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/itoa.o.3 b/build/obj/kaleid/libc/itoa.o.3 new file mode 100644 index 0000000000000000000000000000000000000000..d93a2bf4ddab88c0b13b5331483e68da5c9cc13b GIT binary patch literal 4528 zcmbVPU2IfU5T3KQKih8EwiK0$#sz;Ugx$8tU$Di}g0u)&Y8wQN`jAwIU=4J^-tz7FiT}#~TzItM?3)*t z#>$J{K>Kq;(7&+v;k|wH6UXKc_FZ_?y05&@K74!Z!VPip#@>&{mrB3yy#+8@emHua zd6(`|-1R=RXUa{Z<;9z1-)cgy#hbgZrUvO5memES@#8a0gEAz-WQ9bN6rpAkhSWD6 zMiFX|NGPmCqnuJ!hfEU+OR%A#F=uDEKUG$O850I`{!WqV>fJFg-aaf-faM129!he_JSl<`1J0(68o zp{bhgWEbNr5S`-1XjjCDu8Vex)y*AGq1Ou#iR?iL*X2ntqPrunM8>*si4~5mH3~7- zB@k;`k6g{$DqgR44|H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6QIwwN#hXVg5BQSJdIu~_}+!xel z{zaSAOgOnh{5AjICG-(lVCeC0<6PbT)z!-J)IZ%9djB3`IwwMKN9E^xiZB|wuY*{< z{C8A-UT4Zrke>fT#E6sYL{$z;9V#g+z5W;L^iOXu9M9`Qb?CW?yMqpY99dN;^+E40dOZE6`m=`+%qmBIzaWeT X_w8Hwe-)K_@nQ8M^EEpvsmK2h3;2DR literal 0 HcmV?d00001 diff --git a/build/obj/kaleid/libc/itoa.o.4 b/build/obj/kaleid/libc/itoa.o.4 new file mode 100644 index 0000000000000000000000000000000000000000..2b06d0b4ea87204b71cc5dbfeb54765fc04a6477 GIT binary patch literal 4520 zcmbVPU2IfU5T3KQKih8EZ7CwPM%Et`685%5{(@~Ot;lWzT522c2h0B4?k?=!C3o*a z;XzH2gkqXtA~8l2h`#uwZ-yrWk`SXYF+3SHk;KH9@L&lKC??jKbIkxjcmh4<@V^N>k{fTLA(II6N#C+@72;z; zTk;^x1d-!tDZ37u?A=P3Fo~E($gzqbdf8dFC$_Nj3UU!g=#xg+69B!KBqAn_I|BP@ z4{ktHHQm83#wQ>;#JX^2$Ow0bJH*Q7_J`5yDF}rI5dtt)gAv{ldM=dc#3fcZw$>;_ zqEjH&^f+=gZ?1an?CS5r=1sA)%L{y_E73{BLu)=5?xKj6MlgaNWdM`4qNy^F8A2-G zY+H?)W>>T-=MHQpJU1(_`U}HdeMlQQH!C2p=Dp!H*lYwFpo%+8pn~kMmx9|yxmxK0 zCRtrqg~oO&b-V`Ao}h8a6Zklcv6`tuldRfRXpGhBw-1wQa+%;t1Wd5{a+T;6u7GnG z;EIcE)Y#eWf7tggXFte^IJ^Pwi2WDYs?qP)d3o8GK)^B=4yn0Ju*wN2-9(*qJkJ!c z5w(D{anfTOwX88I%1{Wa!;uoJL-i|gbdA; zDyf16{>ov`$jFZ9dR*oW-WsdTuu4gBY8=E&yXbCf4xYzvnea!|-2FC^nwA1X@WQ#h z=*L($>fV&NP4KVYFx1th&lw#2dF-}vdM%;B{FkH!uuVzEUswEt8vc#4 zcWe0X${yA5o60_*;a@8I4GnKsdGTnIgX_7Y?1F}mDgUyD?@{y(D3!j|DwXl z^snbvK7aqN{$9hG_l6Ir9)4E#FFu@jxUX9pKCbFn@ZrS6uTuAXIPp}JKR@WaZmkM$ zRFVYs#kX--!}%85sBq?aOxb-J{<*4S%YAU(^TgvnCHUE*F#kHgs`zv~s&Ml4`-53N zS#*;rl&<5+9BYnMNSdxSYT*S`TMm= z&4fPmt=Io0Zd4UU{nI{WnEM|_Oy@)hZYl6jGJHe#9m6>tBln-wX1=OTY9<`MPy9#J z6pmg`R6q6j*Knq8|LSVxcXrzK>Q<-6!zFaC;ppjIkA797X&LlwW|>_O~D6|dLD^)ui5sMPEK zk2?KF(3j(RU8oK{H*tHv_5rwm>Vw{j^mzJC^=A(uIHnx=cNSqZxNpzG->0b5i{}@a KPuWpPJ^nu=e10GR literal 0 HcmV?d00001 From 31918c2e6f056e43f48036fdf59e5e916ecac12a Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 10 Apr 2019 10:59:13 +0200 Subject: [PATCH 21/21] Makefile Update --- Makefile | 2 ++ build/obj/kaleid/libc/atoi.o.1 | Bin 3776 -> 0 bytes build/obj/kaleid/libc/atoi.o.2 | Bin 3752 -> 0 bytes build/obj/kaleid/libc/atoi.o.3 | Bin 3776 -> 0 bytes build/obj/kaleid/libc/atoi.o.4 | Bin 3800 -> 0 bytes build/obj/kaleid/libc/itoa.o.1 | Bin 5752 -> 0 bytes build/obj/kaleid/libc/itoa.o.2 | Bin 5656 -> 0 bytes build/obj/kaleid/libc/itoa.o.3 | Bin 4528 -> 0 bytes build/obj/kaleid/libc/itoa.o.4 | Bin 4520 -> 0 bytes 9 files changed, 2 insertions(+) delete mode 100644 build/obj/kaleid/libc/atoi.o.1 delete mode 100644 build/obj/kaleid/libc/atoi.o.2 delete mode 100644 build/obj/kaleid/libc/atoi.o.3 delete mode 100644 build/obj/kaleid/libc/atoi.o.4 delete mode 100644 build/obj/kaleid/libc/itoa.o.1 delete mode 100644 build/obj/kaleid/libc/itoa.o.2 delete mode 100644 build/obj/kaleid/libc/itoa.o.3 delete mode 100644 build/obj/kaleid/libc/itoa.o.4 diff --git a/Makefile b/Makefile index 4e9a9fc..68cee40 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,7 @@ $(KOBJDIR)/libc/atoi.o: $(KALEIDDIR)/libc/atoi.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR @$(KCC) -D_NEED_ATOU $< -o $@.3 @$(KCC) -D_NEED_ATOUL $< -o $@.4 @$(LD) -r $@.1 $@.2 $@.3 $@.4 -o $@ + @rm -f $@.1 $@.2 $@.3 $@.4 @echo ${CL2}[$@] ${CL}Compiled.${CL3} $(KOBJDIR)/libc/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) @@ -128,6 +129,7 @@ $(KOBJDIR)/libc/itoa.o: $(KALEIDDIR)/libc/itoa.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR @$(KCC) -D_NEED_UTOA $< -o $@.3 @$(KCC) -D_NEED_ULTOA $< -o $@.4 @$(LD) -r $@.1 $@.2 $@.3 $@.4 -o $@ + @rm -f $@.1 $@.2 $@.3 $@.4 @echo ${CL2}[$@] ${CL}Compiled.${CL3} $(KOBJDIR)/libc/mem.o: $(KALEIDDIR)/libc/mem.c $(INCLUDEDIR)/*/*.h | $(KOBJDIR) diff --git a/build/obj/kaleid/libc/atoi.o.1 b/build/obj/kaleid/libc/atoi.o.1 deleted file mode 100644 index ae12bfdab70d1e51bd5ea33d4c4c4d61376fe305..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3776 zcmbVOO>7%g5T3W2AE&Mzr)gr9eo*0&Ho50{k$tB`+Fr5q85ktX%#hGk0_DpOx!kzy0gV<)1P??#CSUOP%cn9BKKQRW9mSDJnQDC@?&b(aA7aH-VfRA z0z&9;54ibb*~hXc$8j$i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=mJs{cIK{{{~g)lYM3*T0UK9TOpl82p)(6xp_PPa7liGo1IS zlrM?4?Yjdovg@+{A}J}d{olf~LG@qfLdBozr#)=fA0uYRLEcq45*(z!o^?uGAK92{*Lpv_@Yz?eG}OJ^i1t{4Hx;bKCzvRqQBX diff --git a/build/obj/kaleid/libc/atoi.o.3 b/build/obj/kaleid/libc/atoi.o.3 deleted file mode 100644 index da6d5714b0e8bda93a1d44e000c7e4fbed5ec0d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3776 zcmbVO&yN#z6o22DUAE9|x66X=iqVn?NTltq5jYD`AXU<#J6{F$4(J@@bO4LQGeYx&CWx!-nTlo5mF zOuTV97d|5ba!2JzbJQlooH1gqk@vic%o#C=lVdh&j#w+1G)~TdBO{}oAYtDNi)c6c z5q@36&n8I2-oA>8$*1;_fshoWz8k}eH^)f?Y9EP2TSC8y>O~aukxoz~S9P-A)(jdJ z)QbDJS}Ca0YPO)>P_qEV+%`Pm#wH3Vmna;O`!lFXwW~OlcZ)lUlWOZ&>0vZ|0`mDI z2%*74;1&<(pUa<^!n}#Mn(*WaFFDtBX4!sJWURK~tf4PWoaRTe3f+ltYu~HQ% zZBR@zn$FTMJT#I zo%4L%Y1aHsy#bw|;rE)lR`+5J;3Z+F+MpRv&VQieYMW9vq6AG-880a<0^_<*sh6GY z7+6P97_BC-y4oN&IR4s7d1-F0e6adVb+%mTHo9R``}4jRwKS?hSc!DAav=;@>vq>u zIF1=X;c0}DUZCe&I?z$4fvOiZ+Vks&4pa{8FIQUS%IjzoC(Zd*(8Fw%wY5m=IPrpJ zCul)0h&!!7H_MH-7l9uJt#Tithahf;QDQ+!l!QGWdUT$-q#9q#27eRr{;&g>f}mp$ zYVEMAYk>~eYbT@decednS{PT(rA3k1pu}d_tNR+VrNi;1rNiYX@lyAuHww60Qc@RA zfm$!A9phuUFYrer{82tLbMa!abh@~4UijEBbipLs=R z*rL3b4w1+{d#kvT4N07@SU+gtr#Su*3;&7rB@4gB`bi7F%lcauex3C*7Cz2-aZ?$R zI{#taxA0?ZA6xh##xGeos~~+#e3{4}Ec-_|&X0_fn!V>gGWOYNm%hbbp63$Ble{mm zE_npM$#EaE>;;!uBKz#qCvzluISjnZf{m9Mr=GHXK{Y<#O}sjC9CE|kB1PKws)=4t zpxX2j532PzhN?lEy54K8c7nAK&y4KV>yiFYG(T)?u=FA?Xz7jKekagkPcI?WM%e9Y z+@Wa--CkXbysiug*Z-ibjE;0Ca-R}sfdzTK1eg02eFqBk{4(Vs=b~;1|w+j+6}9wjrJk%YT;>$(&Js`WLnHe~cK#lsZu~w1)@kjFnJS;h&-P zF#k`eD5R|^>wk-%@Ne;iWNx=__YM2obxHkVcnyVN{mY+Twtspn5P!jk<)+v-Ie(iA pr9SAL!1kx#)PD95f?1yb?WAN#`WA?Omtp?X{HJ|g44K>h{{sV`F+>0W diff --git a/build/obj/kaleid/libc/atoi.o.4 b/build/obj/kaleid/libc/atoi.o.4 deleted file mode 100644 index 7ae10191e3833f8b832b2929c80ec93e4d9224bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3800 zcmb_e&2Jl35P#2`4<~jUCn+ITKr&xR3wUiql|mtDlmKZY3IR0-;NY(97u&?%jds_N z=1`*CS}q{90t6CBoGLC{KuG)pa6zaCgv5ov0I33T;ZSDY&N%B=_ktM7o|)g9?;Sty zdoRBHQbJ0>B*lt2))*Dy*Rf-HRg0_QgqRWKTjjscf5&Hcet#UChqRj1VbXlWJj(*` zgiNBAkRzHUMv+-sUc3M-F%&~iRuD;QB#|7}R-|QhMgoV1hFfk(VGh>7ZukhkK8MeU zh~nM44vJ1K?Ta8Xac%OmEEGQ$guakAib&&LyAJAA6nzzfh^{F-LV6g?(sJASQ*Ni_ zMOjMA*JMeEiR6QDKpkdgL7t54q0w)JoRW`aW>QvWJ~Jh!N3-{X>7yc*S^)?QW`&hG zn|dy_IRir_9LgS+a&txkHu4a}8a>^!I+uGs2aVbCTrP54%x%tK;MKX0)^g}EHY}`U z6fyzH#=)0VXyxjWgo19Y<;q~0zIG%Co=)xdU;{4a@T3AR=wD6RcoT< z*4o{=Dps993E_lZ%dX*GhnM$MU^g*k%@4sel3_4W5fIlZNSVk&VCDOsUkOE}QbRYf z@yd37yHD-hA8^F8G!fiIvZFb zcF8gb+&aExVkqJheL5>v?`OzJ#4Q1ria}V(bZibhQ?z8c&xO_{+C#V@^-|&08WGMr zo`vyoz*$C1{$D^GKb&g{4}lo}EmFmO#2J4A69K_}rwP^GPZ;D=5v=3Hr&@~P80%Bg z&lva{6o19QzbAd&z<(iq%fSC4ecQnQAiZkfH%V_9_#D-cS5HM9ClyxCQH6*J9en{Lt)pQ&=Gbu2!yTCx~g^? zm6p5X!I_qwYSmZou-5i!eU^^zxDD0s-EO&x?eW#bu6dn~f-5*mp_-K)-|4{L-Ty&( z2!gZXd2-BE5_q1BoBBK);9J=$8xTKF0pYDe6aL;Y5APY{3xu0D@s{?w`wL^l3EwL) z=705H0$(#G#^?ODacHQb47P*%zeN4-(NbamxTj|SYk-+C0TNdT{1KHHnYLJ`iJ|!h z<$X5hi=t_JX#j?HhvZ*EB}S(ITW~h0|DUN*_Q(G5em46L0W)I)B)+EnyQsv-wDsU@ zP=5Z4-f60c#P5*xZ)iE$O diff --git a/build/obj/kaleid/libc/itoa.o.1 b/build/obj/kaleid/libc/itoa.o.1 deleted file mode 100644 index e00fc7db6c58e84b042ae80ffc8635561256c397..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5752 zcmbtYU2Ggz6~1@wrdfNFT|1^=$3U9*6^9=ggcl zGdrHVz^y#zJKy=c_uMH;_wXBNPq+RO zyZlJI-TsFOkHp^8=z-CL`}U6>6ct!c$Vw5m+O*BWp2uH3Sd(GYG^c^@a&5 zdv_t{TDwiXD&&3a9I>pQXXkE1FADhuwr;bmXYh$*yDfw`1vPiWUsNurTXJ5+*pRnL ztq!L7F2%GEJ>gj}QFom4rTx%_FALc#AB^@zRCF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UNzX=4#cd4!>=-lU`aZnAxgM>-c{K_5*w5?J4FQ#|I4l?%JB$Z`KC^ z;E^0>g5)xN_|l~B0Eu<@UF#?Q)5QCK@%UVkn!sC$H2naaRM+xfaSA{3I<5`-gkv@81k?{+vLGSLkr_cLg~de&59a z4*f1u-S5-)200x5_*wvmetT%5{5ymk4uAX^;DXj4rx%;!asB*F#yos}Rsj2RqWy8I z|6No(!|#j#KP#wyhU#-2tdCpb@Bd}sFelFwpfzrjW64*LRhHiY@1XcaTr3Q%>m3}& z@~2=#Oxx|aE>nEkVQj$jXZl9~g4SOOSU*x6&wUB1jk&K-{g-H>eZb+Z&>xRCPC9CU e-0>AU|9l5$3$L4XyhjDaU!?iJ#*QTY@&5(f1PY1( diff --git a/build/obj/kaleid/libc/itoa.o.2 b/build/obj/kaleid/libc/itoa.o.2 deleted file mode 100644 index a49d01166b6b0e58bc285f433fb6cb7c8fc76271..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5656 zcmbtYU2Ggz6+U-nldQeTt{u0EO_01;h7#zme-g*}kK-iuBn`xFY(-53_Ih``yXpRf z+1=KO5UpZ@*n%lg5KRHuq7Q9ViH9OV`v6o#N>ib#fP{#UP$~pMC=WnWsR2aHId{&P z9gjCJaHE~`o$vhId(XXh<~mOvJ@JsC6i8EW02-RG05{qictpbyxF7BV>+;GetA59- z-@Z^-_*ZK!YrW2nPg%R)iGA^_s97J}IP^LtwbJid^_#cW$GX9)|IWH%eQ@{4;^^tc z4*_fwR^`WZc`txCJ{t6Of|AwB%q zGZQN-D^~sYfBihl#O}et?c0Y3`?v4hHMC=RcxYGuE-2uHLOM}c*K4E3zQ><@*id28 z47FYhV}lkUSAexk4z2Y1pP7R53Yst=n+AYp{#_AmTP}}4RfJd>< zPv9@Arp()F5@KS=xTH}*(`1V&G(cPU5j1gi+J!fM(12G!wX2UtJ0fOuYqVW$-q5xM z19~A6Ie-*^$q>sNQtDWT>cA>}1T(GQ0cLbhWN+kH$HA_B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N+W(HaHoH-TI* zCsOb-Z*F<75JxTOJKcmMzvsB$AsU>o1>?(T3v%TCHh%==J0vNBzUR=;Z2oV=+z5%M z`O`ZmIR6FYf;lPjKivQKN%6IyFa0-Dv;P0i{mVY3{%J{q{Xc^o<&<$E)a`k8%mq3W zRpj&N-7Maq$zr2^{Y~OTzJx}?yxg8^C&ybJ;{qAK&@UipHvcfcSpD-SO5%lY);Hyz v;r^fFfp#EAx58jN-8gxxA!@Wce5;l_xL9P~qSHO9S$v$w|Ef5$495Q#f#?G9 diff --git a/build/obj/kaleid/libc/itoa.o.3 b/build/obj/kaleid/libc/itoa.o.3 deleted file mode 100644 index d93a2bf4ddab88c0b13b5331483e68da5c9cc13b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4528 zcmbVPU2IfU5T3KQKih8EwiK0$#sz;Ugx$8tU$Di}g0u)&Y8wQN`jAwIU=4J^-tz7FiT}#~TzItM?3)*t z#>$J{K>Kq;(7&+v;k|wH6UXKc_FZ_?y05&@K74!Z!VPip#@>&{mrB3yy#+8@emHua zd6(`|-1R=RXUa{Z<;9z1-)cgy#hbgZrUvO5memES@#8a0gEAz-WQ9bN6rpAkhSWD6 zMiFX|NGPmCqnuJ!hfEU+OR%A#F=uDEKUG$O850I`{!WqV>fJFg-aaf-faM129!he_JSl<`1J0(68o zp{bhgWEbNr5S`-1XjjCDu8Vex)y*AGq1Ou#iR?iL*X2ntqPrunM8>*si4~5mH3~7- zB@k;`k6g{$DqgR44|HSm3Gr&TAGoo5tc!?;)_ykJO%W}PV1#|j5GHFyQ)M7Cf>eRo zwkk8tu4+}zo!CsYJSVXFE5qIWNZWpCPC#hwC&O#8*>-GzD(*}G6=X;K6x=q-HA)vS z#p<&aXndzq4_2W=N}Z}gtiDr$rdXY+K;x`detqCL@0iGWE~U#}3o#T9T413Yn+ zjVk+Om2bHw_d7xYjdO(jm7c`KLh&F7LS z$l0lUDQ)#8&7uX6^BgmgqVvx?_nuWuWGQ9J_0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