diff --git a/brewos.iso b/brewos.iso index 303cf04..cc2891e 100644 Binary files a/brewos.iso and b/brewos.iso differ diff --git a/build/brewos.elf b/build/brewos.elf index a339972..de32de5 100755 Binary files a/build/brewos.elf and b/build/brewos.elf differ diff --git a/build/cmd.o b/build/cmd.o index 3a4dbc7..49a7504 100644 Binary files a/build/cmd.o and b/build/cmd.o differ diff --git a/build/vm.o b/build/vm.o index 7a0fd7a..7a4f913 100644 Binary files a/build/vm.o and b/build/vm.o differ diff --git a/iso_root/README.md b/iso_root/README.md index 49a3fac..fbeb795 100644 --- a/iso_root/README.md +++ b/iso_root/README.md @@ -1,4 +1,4 @@ -# Brew OS 1.12 Alpha +# Brew OS 1.20 Alpha ## Brewkernel is now BrewOS! Brewkernel will from now on be deprecated as it's core became too messy. I have built a less bloated kernel and wrote a DE above it, which is why it is now an OS instead of a kernel (in my opinion). diff --git a/iso_root/brewos.elf b/iso_root/brewos.elf index a339972..de32de5 100755 Binary files a/iso_root/brewos.elf and b/iso_root/brewos.elf differ diff --git a/src/kernel/cmd.c b/src/kernel/cmd.c index ede96ee..f89d67b 100644 --- a/src/kernel/cmd.c +++ b/src/kernel/cmd.c @@ -1026,14 +1026,30 @@ static void create_test_files(void) { fh = fat32_open("Apps/wordofgod.c", "w"); if (fh) { - const char *content = - "int main() {\n" - " // Word of god (inspired by TempleOS (RIP Terry Davis)\n " - " puts(\"Word of God:\\n\");\n" - " print_int(rand());\n" - " puts(\"\\n\");\n" - "}\n"; - fat32_write(fh, (void *)content, cmd_strlen(content)); + char *h = "int main(){int l;l=malloc(400);"; + fat32_write(fh, h, cmd_strlen(h)); + char *w1 = "poke(l+0,\"In\");poke(l+4,\"the\");poke(l+8,\"beginning\");poke(l+12,\"God\");poke(l+16,\"created\");poke(l+20,\"heaven\");poke(l+24,\"and\");poke(l+28,\"earth\");poke(l+32,\"light\");poke(l+36,\"darkness\");"; + fat32_write(fh, w1, cmd_strlen(w1)); + char *w2 = "poke(l+40,\"day\");poke(l+44,\"night\");poke(l+48,\"waters\");poke(l+52,\"firmament\");poke(l+56,\"evening\");poke(l+60,\"morning\");poke(l+64,\"land\");poke(l+68,\"seas\");poke(l+72,\"grass\");poke(l+76,\"herb\");"; + fat32_write(fh, w2, cmd_strlen(w2)); + char *w3 = "poke(l+80,\"seed\");poke(l+84,\"fruit\");poke(l+88,\"tree\");poke(l+92,\"sun\");poke(l+96,\"moon\");poke(l+100,\"stars\");poke(l+104,\"signs\");poke(l+108,\"seasons\");poke(l+112,\"days\");poke(l+116,\"years\");"; + fat32_write(fh, w3, cmd_strlen(w3)); + char *w4 = "poke(l+120,\"creature\");poke(l+124,\"life\");poke(l+128,\"fowl\");poke(l+132,\"whales\");poke(l+136,\"cattle\");poke(l+140,\"creeping\");poke(l+144,\"beast\");poke(l+148,\"man\");poke(l+152,\"image\");poke(l+156,\"likeness\");"; + fat32_write(fh, w4, cmd_strlen(w4)); + char *w5 = "poke(l+160,\"dominion\");poke(l+164,\"fish\");poke(l+168,\"air\");poke(l+172,\"every\");poke(l+176,\"green\");poke(l+180,\"meat\");poke(l+184,\"holy\");poke(l+188,\"rest\");poke(l+192,\"dust\");poke(l+196,\"breath\");"; + fat32_write(fh, w5, cmd_strlen(w5)); + char *w6 = "poke(l+200,\"soul\");poke(l+204,\"garden\");poke(l+208,\"east\");poke(l+212,\"Eden\");poke(l+216,\"ground\");poke(l+220,\"sight\");poke(l+224,\"good\");poke(l+228,\"evil\");poke(l+232,\"river\");poke(l+236,\"gold\");"; + fat32_write(fh, w6, cmd_strlen(w6)); + char *w7 = "poke(l+240,\"stone\");poke(l+244,\"woman\");poke(l+248,\"wife\");poke(l+252,\"flesh\");poke(l+256,\"bone\");poke(l+260,\"naked\");poke(l+264,\"serpent\");poke(l+268,\"subtle\");poke(l+272,\"eat\");poke(l+276,\"eyes\");"; + fat32_write(fh, w7, cmd_strlen(w7)); + char *w8 = "poke(l+280,\"wise\");poke(l+284,\"cool\");poke(l+288,\"voice\");poke(l+292,\"fear\");poke(l+296,\"hid\");poke(l+300,\"cursed\");poke(l+304,\"belly\");poke(l+308,\"enmity\");poke(l+312,\"sorrow\");poke(l+316,\"conception\");"; + fat32_write(fh, w8, cmd_strlen(w8)); + char *w9 = "poke(l+320,\"children\");poke(l+324,\"desire\");poke(l+328,\"husband\");poke(l+332,\"thorns\");poke(l+336,\"thistles\");poke(l+340,\"sweat\");poke(l+344,\"bread\");poke(l+348,\"mother\");poke(l+352,\"skin\");poke(l+356,\"coats\");"; + fat32_write(fh, w9, cmd_strlen(w9)); + char *w10 = "poke(l+360,\"cherubims\");poke(l+364,\"sword\");poke(l+368,\"gate\");poke(l+372,\"offering\");poke(l+376,\"respect\");poke(l+380,\"sin\");poke(l+384,\"door\");poke(l+388,\"blood\");poke(l+392,\"brother\");poke(l+396,\"keeper\");"; + fat32_write(fh, w10, cmd_strlen(w10)); + char *e = "int c;int r;r=rand();r=r-(r/3)*3;c=5+r;int i;i=0;while(i= VM_MEMORY_SIZE) { + int res = vm_heap_ptr; + vm_heap_ptr += size; + if (vm_heap_ptr >= VM_MEMORY_SIZE) { push(0); // OOM } else { push(res); @@ -305,6 +306,7 @@ static void vm_syscall(int id) { if (addr >= 0 && addr < VM_MEMORY_SIZE) { cli_itoa(val, (char*)&memory[addr]); } + push(0); break; } case SYS_PEEK: push(mem_read32(pop())); break; @@ -312,6 +314,7 @@ static void vm_syscall(int id) { int val = pop(); int addr = pop(); mem_write32(addr, val); + push(0); break; } case SYS_EXEC: pop(); push(-1); break; // Not impl diff --git a/src/kernel/vm.h b/src/kernel/vm.h index f7de263..61de13b 100644 --- a/src/kernel/vm.h +++ b/src/kernel/vm.h @@ -9,7 +9,7 @@ #define VM_MAGIC "BREWEXE" #define VM_STACK_SIZE 256 -#define VM_MEMORY_SIZE (64 * 1024) // 64KB RAM +#define VM_MEMORY_SIZE (64 * 1024) // 64KB typedef enum { OP_HALT = 0,