Add changes in makefile

Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar>
Co-authored-by: Juan Barmasch <jbarmasch@itba.edu.ar>
This commit is contained in:
Santiago Lo Coco 2021-11-01 09:38:24 -03:00
parent 8838beda5e
commit 10783bd50e
8 changed files with 152 additions and 139 deletions

View File

@ -17,6 +17,7 @@ OBJECTS_INTERRUPTIONS=$(SOURCES_INTERRUPTIONS:.c=.o)
OBJECTS_INTERRUPTIONS_ASM=$(SOURCES_INTERRUPTIONS_ASM:.asm=.o) OBJECTS_INTERRUPTIONS_ASM=$(SOURCES_INTERRUPTIONS_ASM:.asm=.o)
OBJECTS_ASM=$(SOURCES_ASM:.asm=.o) OBJECTS_ASM=$(SOURCES_ASM:.asm=.o)
LOADERSRC=loader.asm LOADERSRC=loader.asm
FLAGS=../flags.txt
LOADEROBJECT=$(LOADERSRC:.asm=.o) LOADEROBJECT=$(LOADERSRC:.asm=.o)
STATICLIBS= STATICLIBS=
@ -31,8 +32,8 @@ $(KERNEL): $(STATICLIBS) $(ALL_OBJECTS)
$(KERNEL_ELF): $(STATICLIBS) $(ALL_OBJECTS) $(KERNEL_ELF): $(STATICLIBS) $(ALL_OBJECTS)
$(LD) $(LDFLAGS) -T kernel.ld --oformat=elf64-x86-64 -o $@ $^ $(LD) $(LDFLAGS) -T kernel.ld --oformat=elf64-x86-64 -o $@ $^
%.o: %.c %.o: %.c $(FLAGS)
$(GCC) $(GCCFLAGS) -I./include -I./drivers/include -I./interruptions/include -I./utils/include -I./tests/include $(MFLAG) -c $< -o $@ $(GCC) $(GCCFLAGS) -I./include -I./drivers/include -I./interruptions/include -I./utils/include -I./tests/include $(MFLAG) $(KFLAG) -c $< -o $@
%.o : %.asm %.o : %.asm
$(ASM) $(ASMFLAGS) $< -o $@ $(ASM) $(ASMFLAGS) $< -o $@

View File

@ -4,8 +4,6 @@
#include <stdint.h> #include <stdint.h>
#include "../../utils/include/schedulerLib.h" #include "../../utils/include/schedulerLib.h"
#define SIZE 1
void keyboard_handler(); void keyboard_handler();
unsigned char getKeyFromBuffer(); unsigned char getKeyFromBuffer();
unsigned char getCharInterrupt(); unsigned char getCharInterrupt();

View File

@ -1,9 +1,9 @@
#include "keyboard.h" #include "keyboard.h"
static unsigned char kbdus[250]; #define SIZE 1
static unsigned char kbdus_sh[250];
// static unsigned char kbdsp_sh[250]; static unsigned char kbd[250];
// static unsigned char kbdsp[250]; static unsigned char kbd_sh[250];
unsigned char buffer[SIZE] = {0}; unsigned char buffer[SIZE] = {0};
unsigned char *current = buffer; unsigned char *current = buffer;
@ -48,11 +48,11 @@ void testKeyboardInterrupt(unsigned char c) {
} }
if (flag == 0) { if (flag == 0) {
c = kbdus_sh[c]; c = kbd_sh[c];
if (c != 0) if (c != 0)
saveChar(c); saveChar(c);
} else { } else {
c = kbdus[c]; c = kbd[c];
if (c != 0) if (c != 0)
saveChar(c); saveChar(c);
} }
@ -74,46 +74,8 @@ void keyboard_handler() {
testKeyboardInterrupt(c); testKeyboardInterrupt(c);
} }
// static unsigned char kbdsp[250] = { #ifndef SPANISH
// 0, 124, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */ static unsigned char kbd[250] = {
// '9', '0', '\'', 168, '\b', /* Backspace */
// '\t', /* Tab */
// 'q', 'w', 'e', 'r', /* 19 */
// 't', 'y', 'u', 'i', 'o', 'p', 96, '+', '\n', /* Enter key */
// 0, /* 29 - Control */
// 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 164, /* ñ */
// '{', '}', 0, /* Left shift */
// '<', 'z', 'x', 'c', 'v', 'b', 'n', /* 49 */
// 'm', ',', '.', '-', 0, /* Right shift */
// '*',
// 0, /* Alt */
// ' ', /* Space bar */
// 0, /* Caps lock */
// 0, /* 59 - F1 key ... > */
// 0, 0, 0, 0, 0, 0, 0, 0,
// 0, /* < ... F10 */
// 0, /* 69 - Num lock*/
// 0, /* Scroll Lock */
// 0, /* Home key */
// 0, /* Up Arrow */
// 0, /* Page Up */
// '-',
// 0, /* Left Arrow */
// 0,
// 0, /* Right Arrow */
// '+',
// 0, /* 79 - End key*/
// 0, /* Down Arrow */
// 0, /* Page Down */
// 0, /* Insert Key */
// 0, /* Delete Key */
// 0, 0, 0,
// 0, /* F11 Key */
// 0, /* F12 Key */
// 0, /* All other keys are undefined */
// };
static unsigned char kbdus[250] = {
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */ 0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
'9', '0', '-', '=', '\b', /* Backspace */ '9', '0', '-', '=', '\b', /* Backspace */
'\t', /* Tab */ '\t', /* Tab */
@ -151,83 +113,119 @@ static unsigned char kbdus[250] = {
0, /* F12 Key */ 0, /* F12 Key */
0, /* All other keys are undefined */ 0, /* All other keys are undefined */
}; };
static unsigned char kbd_sh[250] = {
// static unsigned char kbdsp_sh[250] = 0, 27, '!', '\"', '#', 0 /* shift+4 */, '%', '&', '/', '(', /* 9 */
// { ')', '=', '?', '`', '\b', /* Backspace */
// 0, 167, 21, '\"', '#', '$', '%', '&', '/', '(', /* 9 */ '\t', /* Tab */
// ')', '=', '?', 173, '\b', /* Backspace */ 'Q', 'W', 'E', 'R', /* 19 */
// '\t', /* Tab */ 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', /* Enter key */
// 'Q', 'W', 'E', 'R', /* 19 */ 0, /* 29 - Control */
// 'T', 'Y', 'U', 'I', 'O', 'P', 0, '*', '\n', /* Enter key */ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 39 */
// 0, /* 29 - Control */ '\'', '>', 0, /* Left shift */
// 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 165, /* 39 */ '|', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */
// '[', ']', 0, /* Left shift */ 'M', ';', ':', '_', 0, /* Right shift */
// '>', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */ '*',
// 'M', ';', ':', '_', 0, /* Right shift */ 0, /* Alt */
// '*', ' ', /* Space bar */
// 0, /* Alt */ 0, /* Caps lock */
// ' ', /* Space bar */ 0, /* 59 - F1 key ... > */
// 0, /* Caps lock */ 0, 0, 0, 0, 0, 0, 0, 0,
// 0, /* 59 - F1 key ... > */ 0, /* < ... F10 */
// 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 69 - Num lock*/
// 0, /* < ... F10 */ 0, /* Scroll Lock */
// 0, /* 69 - Num lock*/ 0, /* Home key */
// 0, /* Scroll Lock */ 0, /* Up Arrow */
// 0, /* Home key */ 0, /* Page Up */
// 0, /* Up Arrow */ '-',
// 0, /* Page Up */ 0, /* Left Arrow */
// '-', 0,
// 0, /* Left Arrow */ 0, /* Right Arrow */
// 0, '+',
// 0, /* Right Arrow */ 0, /* 79 - End key*/
// '+', 0, /* Down Arrow */
// 0, /* 79 - End key*/ 0, /* Page Down */
// 0, /* Down Arrow */ 0, /* Insert Key */
// 0, /* Page Down */ 0, /* Delete Key */
// 0, /* Insert Key */ 0, 0, '>',
// 0, /* Delete Key */ 0, /* F11 Key */
// 0, 0, '>', 0, /* F12 Key */
// 0, /* F11 Key */ 0, /* All other keys are undefined */
// 0, /* F12 Key */ };
// 0, /* All other keys are undefined */ #else
// }; static unsigned char kbd[250] = {
0, 124, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
static unsigned char kbdus_sh[250] = '9', '0', '\'', 168, '\b', /* Backspace */
{ '\t', /* Tab */
0, 27, '!', '\"', '#', 0 /* shift+4 */, '%', '&', '/', '(', /* 9 */ 'q', 'w', 'e', 'r', /* 19 */
')', '=', '?', '`', '\b', /* Backspace */ 't', 'y', 'u', 'i', 'o', 'p', 96, '+', '\n', /* Enter key */
'\t', /* Tab */ 0, /* 29 - Control */
'Q', 'W', 'E', 'R', /* 19 */ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 164, /* ñ */
'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', /* Enter key */ '{', '}', 0, /* Left shift */
0, /* 29 - Control */ '<', 'z', 'x', 'c', 'v', 'b', 'n', /* 49 */
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 39 */ 'm', ',', '.', '-', 0, /* Right shift */
'\'', '>', 0, /* Left shift */ '*',
'|', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */ 0, /* Alt */
'M', ';', ':', '_', 0, /* Right shift */ ' ', /* Space bar */
'*', 0, /* Caps lock */
0, /* Alt */ 0, /* 59 - F1 key ... > */
' ', /* Space bar */ 0, 0, 0, 0, 0, 0, 0, 0,
0, /* Caps lock */ 0, /* < ... F10 */
0, /* 59 - F1 key ... > */ 0, /* 69 - Num lock*/
0, 0, 0, 0, 0, 0, 0, 0, 0, /* Scroll Lock */
0, /* < ... F10 */ 0, /* Home key */
0, /* 69 - Num lock*/ 0, /* Up Arrow */
0, /* Scroll Lock */ 0, /* Page Up */
0, /* Home key */ '-',
0, /* Up Arrow */ 0, /* Left Arrow */
0, /* Page Up */ 0,
'-', 0, /* Right Arrow */
0, /* Left Arrow */ '+',
0, 0, /* 79 - End key*/
0, /* Right Arrow */ 0, /* Down Arrow */
'+', 0, /* Page Down */
0, /* 79 - End key*/ 0, /* Insert Key */
0, /* Down Arrow */ 0, /* Delete Key */
0, /* Page Down */ 0, 0, 0,
0, /* Insert Key */ 0, /* F11 Key */
0, /* Delete Key */ 0, /* F12 Key */
0, 0, '>', 0, /* All other keys are undefined */
0, /* F11 Key */ };
0, /* F12 Key */ static unsigned char kbd_sh[250] = {
0, /* All other keys are undefined */ 0, 167, 21, '\"', '#', '$', '%', '&', '/', '(', /* 9 */
}; ')', '=', '?', 173, '\b', /* Backspace */
'\t', /* Tab */
'Q', 'W', 'E', 'R', /* 19 */
'T', 'Y', 'U', 'I', 'O', 'P', 0, '*', '\n', /* Enter key */
0, /* 29 - Control */
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 165, /* 39 */
'[', ']', 0, /* Left shift */
'>', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */
'M', ';', ':', '_', 0, /* Right shift */
'*',
0, /* Alt */
' ', /* Space bar */
0, /* Caps lock */
0, /* 59 - F1 key ... > */
0, 0, 0, 0, 0, 0, 0, 0,
0, /* < ... F10 */
0, /* 69 - Num lock*/
0, /* Scroll Lock */
0, /* Home key */
0, /* Up Arrow */
0, /* Page Up */
'-',
0, /* Left Arrow */
0,
0, /* Right Arrow */
'+',
0, /* 79 - End key*/
0, /* Down Arrow */
0, /* Page Down */
0, /* Insert Key */
0, /* Delete Key */
0, 0, '>',
0, /* F11 Key */
0, /* F12 Key */
0, /* All other keys are undefined */
};
#endif

View File

@ -36,7 +36,7 @@ uint64_t read(uint64_t fd, uint64_t buffer, uint64_t length) {
blockIO(); blockIO();
} }
if (*bufferAux == '\v') { if (*bufferAux == '\v') {
return -1; return 0;
// break; // break;
} }
readBytes++; readBytes++;

View File

@ -44,10 +44,10 @@ int ceil(float num) {
return inum + 1; return inum + 1;
} }
// unsigned int log2(unsigned int n) unsigned int log2(unsigned int n)
// { {
// return (n > 1) ? 1 + log2(n / 2) : 0; return (n > 1) ? 1 + log2(n / 2) : 0;
// } }
// /* Returns log base 2 of a double d */ // /* Returns log base 2 of a double d */
// double log2(double d) { // double log2(double d) {

View File

@ -170,7 +170,7 @@ char *getEntering(sem_t *sem) {
} }
char *getSems() { char *getSems() {
char *ans = pvPortMalloc(counter * SEM_DATA_MAX_SIZE); char *ans = pvPortMalloc(1 + counter * SEM_DATA_MAX_SIZE);
char *ret = ans; char *ret = ans;
char *info = "name value pidsWaiting\n"; char *info = "name value pidsWaiting\n";

View File

@ -1,13 +1,24 @@
all: bootloader kernel userland image all: bootloader kernel userland image
buddy: bootloader kernelBuddy userland image spanish: bootloader kernelSpanish userland imageSpanish
buddy: bootloader kernelBuddy userland imageBuddy
bootloader: bootloader:
cd Bootloader; make all cd Bootloader; make all
kernel: kernel:
@if ! grep -q "ke" flags.txt; then\
echo "ke" > flags.txt;\
fi
cd Kernel; make all cd Kernel; make all
kernelSpanish:
@if ! grep -q "ks" flags.txt; then\
echo "ks" > flags.txt;\
fi
cd Kernel; make all KFLAG=-DSPANISH
kernelBuddy: kernelBuddy:
@if ! grep -q "be" flags.txt; then\
echo "be" > flags.txt;\
fi
cd Kernel; make all MFLAG=-DBUDDY cd Kernel; make all MFLAG=-DBUDDY
userland: userland:
@ -15,6 +26,10 @@ userland:
image: kernel bootloader userland image: kernel bootloader userland
cd Image; make all cd Image; make all
imageSpanish: kernelSpanish bootloader userland
cd Image; make all
imageBuddy: kernelBuddy bootloader userland
cd Image; make all
clean: clean:
cd Bootloader; make clean cd Bootloader; make clean
@ -22,4 +37,4 @@ clean:
cd Kernel; make clean cd Kernel; make clean
cd Userland; make clean cd Userland; make clean
.PHONY: bootloader image collections kernel userland all clean .PHONY: bootloader image imageSpanish imageBuddy collections kernel kernelSpanish kernelBuddy userland all clean

1
flags.txt Normal file
View File

@ -0,0 +1 @@
ke