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

View File

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

View File

@ -1,9 +1,9 @@
#include "keyboard.h"
static unsigned char kbdus[250];
static unsigned char kbdus_sh[250];
// static unsigned char kbdsp_sh[250];
// static unsigned char kbdsp[250];
#define SIZE 1
static unsigned char kbd[250];
static unsigned char kbd_sh[250];
unsigned char buffer[SIZE] = {0};
unsigned char *current = buffer;
@ -48,11 +48,11 @@ void testKeyboardInterrupt(unsigned char c) {
}
if (flag == 0) {
c = kbdus_sh[c];
c = kbd_sh[c];
if (c != 0)
saveChar(c);
} else {
c = kbdus[c];
c = kbd[c];
if (c != 0)
saveChar(c);
}
@ -74,46 +74,8 @@ void keyboard_handler() {
testKeyboardInterrupt(c);
}
// static unsigned char kbdsp[250] = {
// 0, 124, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
// '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] = {
#ifndef SPANISH
static unsigned char kbd[250] = {
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
'9', '0', '-', '=', '\b', /* Backspace */
'\t', /* Tab */
@ -151,83 +113,119 @@ static unsigned char kbdus[250] = {
0, /* F12 Key */
0, /* All other keys are undefined */
};
// static unsigned char kbdsp_sh[250] =
// {
// 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 */
// };
static unsigned char kbdus_sh[250] =
{
0, 27, '!', '\"', '#', 0 /* shift+4 */, '%', '&', '/', '(', /* 9 */
')', '=', '?', '`', '\b', /* Backspace */
'\t', /* Tab */
'Q', 'W', 'E', 'R', /* 19 */
'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', /* Enter key */
0, /* 29 - Control */
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 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 */
};
static unsigned char kbd_sh[250] = {
0, 27, '!', '\"', '#', 0 /* shift+4 */, '%', '&', '/', '(', /* 9 */
')', '=', '?', '`', '\b', /* Backspace */
'\t', /* Tab */
'Q', 'W', 'E', 'R', /* 19 */
'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', /* Enter key */
0, /* 29 - Control */
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', /* 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 */
};
#else
static unsigned char kbd[250] = {
0, 124, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
'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 kbd_sh[250] = {
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();
}
if (*bufferAux == '\v') {
return -1;
return 0;
// break;
}
readBytes++;

View File

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

View File

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

View File

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