I am gonna be departed to Belorussia in 1 day. I have only 1 day left to do bdz *crying emoji*
This commit is contained in:
parent
bc793634cb
commit
4ef561edf5
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,5 +11,7 @@ user/*
|
|||||||
user/*.o
|
user/*.o
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
cmake-build-debug
|
||||||
|
CMakeLists.txt
|
||||||
__pycache__
|
__pycache__
|
||||||
res.txt
|
res.txt
|
||||||
|
|||||||
4
Makefile
4
Makefile
@ -19,7 +19,7 @@ endif
|
|||||||
CFLAGS = -fno-pic -ffreestanding -static -fno-builtin -fno-strict-aliasing \
|
CFLAGS = -fno-pic -ffreestanding -static -fno-builtin -fno-strict-aliasing \
|
||||||
-mno-sse \
|
-mno-sse \
|
||||||
-I. \
|
-I. \
|
||||||
-Wall -ggdb -m32 -Werror -fno-omit-frame-pointer -Os
|
-Wall -Wno-unused-result -ggdb -m32 -Werror -fno-omit-frame-pointer -Os
|
||||||
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
|
||||||
ASMFLAGS = -m32 -ffreestanding -c -g -I.
|
ASMFLAGS = -m32 -ffreestanding -c -g -I.
|
||||||
|
|
||||||
@ -141,4 +141,4 @@ clean:
|
|||||||
rm -f *.elf *.img *.bin *.raw *.o */*.o tools/mkfs ejudge.sh
|
rm -f *.elf *.img *.bin *.raw *.o */*.o tools/mkfs ejudge.sh
|
||||||
|
|
||||||
tools/%: tools/%.c
|
tools/%: tools/%.c
|
||||||
gcc -Wall -Werror -g $^ -o $@
|
gcc -Wall -Wno-unused-result -Werror -g $^ -o $@
|
||||||
|
|||||||
@ -20,6 +20,7 @@ static inline void port_word_out(unsigned short port, unsigned short data) {
|
|||||||
asm volatile("outw %%ax, %%dx" : : "a" (data), "d" (port));
|
asm volatile("outw %%ax, %%dx" : : "a" (data), "d" (port));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* assembler-long, not c-long */
|
||||||
static inline void port_long_out(unsigned short port, unsigned int data) {
|
static inline void port_long_out(unsigned short port, unsigned int data) {
|
||||||
asm volatile("outl %%eax, %%dx" : : "a" (data), "d" (port));
|
asm volatile("outl %%eax, %%dx" : : "a" (data), "d" (port));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ uartputc(char c)
|
|||||||
|
|
||||||
if (!uart)
|
if (!uart)
|
||||||
return;
|
return;
|
||||||
|
/* What is that *skeleton emoji*? */
|
||||||
for (i = 0; i < 128 && !(port_byte_in(COM1+5) & 0x20); i++) {
|
for (i = 0; i < 128 && !(port_byte_in(COM1+5) & 0x20); i++) {
|
||||||
asm("pause");
|
asm("pause");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
static char* const video_memory = (char*) (KERNBASE + 0xb8000);
|
static char* const video_memory = (char*) (KERNBASE + 0xb8000);
|
||||||
|
|
||||||
enum colors16 {
|
enum colors16 : unsigned char {
|
||||||
black = 0,
|
black = 0,
|
||||||
blue,
|
blue,
|
||||||
green,
|
green,
|
||||||
|
|||||||
1
fs/fs.h
1
fs/fs.h
@ -31,6 +31,7 @@ struct dirent {
|
|||||||
char name[20];
|
char name[20];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* This way we have 512 bytes (1 sector) per dir */
|
||||||
struct dir {
|
struct dir {
|
||||||
char reserved[32];
|
char reserved[32];
|
||||||
struct dirent entries[ents_in_dir];
|
struct dirent entries[ents_in_dir];
|
||||||
|
|||||||
21
lib/bribki.h
Normal file
21
lib/bribki.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* Bribki are stored here */
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char chars[5];
|
||||||
|
} DebugBribka;
|
||||||
|
|
||||||
|
DebugBribka byte_to_string_bribka(uint8_t byte) {
|
||||||
|
DebugBribka res = {.chars = {' ', ' ', ' ', ' ', 0}};
|
||||||
|
int p = 3;
|
||||||
|
while (byte > 0) {
|
||||||
|
uint8_t d = byte % 10;
|
||||||
|
byte /= 10;
|
||||||
|
res.chars[p] = (char)(d) + '0';
|
||||||
|
p--;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
1
mbr.S
1
mbr.S
@ -11,6 +11,7 @@ _start:
|
|||||||
mov %cr0, %eax
|
mov %cr0, %eax
|
||||||
or $1, %eax // 3. enable protected mode
|
or $1, %eax // 3. enable protected mode
|
||||||
mov %eax, %cr0
|
mov %eax, %cr0
|
||||||
|
|
||||||
ljmp $SEG_KCODE << 3, $init_32bit // 4. far jump
|
ljmp $SEG_KCODE << 3, $init_32bit // 4. far jump
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
53
tasks/float_basic/fp16/run/output
Normal file
53
tasks/float_basic/fp16/run/output
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
67FE
|
||||||
|
63FE
|
||||||
|
5FFE
|
||||||
|
5BFE
|
||||||
|
57FE
|
||||||
|
53FE
|
||||||
|
4FFE
|
||||||
|
4BFE
|
||||||
|
47FE
|
||||||
|
43FE
|
||||||
|
3FFE
|
||||||
|
3BFE
|
||||||
|
37FE
|
||||||
|
33FE
|
||||||
|
2FFE
|
||||||
|
2BFE
|
||||||
|
27FE
|
||||||
|
23FE
|
||||||
|
1FFE
|
||||||
|
1BFE
|
||||||
|
17FE
|
||||||
|
13FE
|
||||||
|
0FFE
|
||||||
|
0BFE
|
||||||
|
07FE
|
||||||
|
03FF
|
||||||
|
6680
|
||||||
|
6280
|
||||||
|
5E80
|
||||||
|
5A80
|
||||||
|
5680
|
||||||
|
5280
|
||||||
|
4E80
|
||||||
|
4A80
|
||||||
|
4680
|
||||||
|
4280
|
||||||
|
3E80
|
||||||
|
3A80
|
||||||
|
3680
|
||||||
|
3280
|
||||||
|
2E80
|
||||||
|
2A80
|
||||||
|
2680
|
||||||
|
2280
|
||||||
|
1E80
|
||||||
|
1A80
|
||||||
|
1680
|
||||||
|
1280
|
||||||
|
0E80
|
||||||
|
0A80
|
||||||
|
0680
|
||||||
|
0340
|
||||||
|
019F
|
||||||
BIN
tasks/float_basic/fp16/solution
Executable file
BIN
tasks/float_basic/fp16/solution
Executable file
Binary file not shown.
BIN
tasks/float_basic/okay-1/solution
Executable file
BIN
tasks/float_basic/okay-1/solution
Executable file
Binary file not shown.
BIN
tasks/x86_review/anagram/solution
Executable file
BIN
tasks/x86_review/anagram/solution
Executable file
Binary file not shown.
BIN
tasks/x86_review/count/solution
Executable file
BIN
tasks/x86_review/count/solution
Executable file
Binary file not shown.
BIN
tasks/x86_review/ppm-magic/a.out
Executable file
BIN
tasks/x86_review/ppm-magic/a.out
Executable file
Binary file not shown.
BIN
tasks/x86_review/ppm-magic/solution
Executable file
BIN
tasks/x86_review/ppm-magic/solution
Executable file
Binary file not shown.
BIN
tasks/x86_review/recursion/solution
Executable file
BIN
tasks/x86_review/recursion/solution
Executable file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user