First, proof of concept

このコミットが含まれているのは:
Vilyaem 2024-04-22 21:53:25 -04:00
コミット 431ac2d671
7個のファイルの変更708行の追加0行の削除

129
README.md ノーマルファイル
ファイルの表示

@ -0,0 +1,129 @@
# ZOS OPERATING SYSTEM
"I hate computers so much,
I wrote an operating system,
I still hate computers"
- Vilyaem
ZOS (zaws) is a free single-threaded single-user operating system written from scratch
in C (ANSI C89), Assembly, and S (its own programming language). ZOS is for the x86-64
and *duino architectures. ZOS features a boot loader, kernel, interpreter, shell, text editor,
graphics, core utilities, and (optional) filesystem. ZOS' objective is to be an ultrafunctionalist high performant 'suckless'
operating system with a heavy focus on simplicity and freedom, ZOS is also designed to be the primary operating
system for the quickly approaching collapse of modern secular society.
ZOS by default, does not come with a graphical interface, desktop environment, or window manager,
it is primarily command line driven. ZOS has no internet/network connectivity, GPU support, segmentation,
rings, rootkit, proprietary blobs, WiFi card support, multiple disk support, support for other filesystems (FAT,ext,NTFS...),
or USB support, all of these are positives.
ZOS only supports its own file system, MiniFS. Operating systems that are most similar, either conceptually
or ideologically are 86-DOS (1980), TempleOS (2018), and CollapseOS. ZOS is NOT based off of Unix or DOS.
ZOS uses an optional RAM based filesystem, and only very rarily writes to disk, this contributes greatly to the performance
of the system, as a hard disk is the slowest form of memory to access and alter, also some systems, especially embedded
devices, do not have harddisks.
ZOS can easily be compiled and emulated on POSIX, DOS, and Windows machines
so that users may develop or learn the operating system.
---
I, Vilyaem, have created ZOS over the course of a couple weeks.
I wanted a system that could be for once considered both 'lightweight' and effective.
The system with its clear and sober mission absolutely clobbers
horrid disasters such as gnooh/Linux and Windows, software should be designed
absolutely perfectly and last for eternity, akin to the Roman Empire,
or the word of God. This is not even the goal of most software production,
so its not a mystery why modern computing is an unending disaster.
---
Line count/complexity comparison:
Windows - >50,000,000 proprietary lines
Linux - >36,000,000 lines
Temple OS - 131,000 lines
FreeDOS - 32,000 lines
Dusk OS - 10,000 lines
86DOS - 7100 lines
ZOS - <2,500 lines
---
Screenshots:
![A user writing a program with the Vedlin text editor](screenshot1.PNG "A user writing a program with the Vedlin text editor")
![A 3D graphical video game written in S running on ZOS](screenshot2.PNG "A 3D graphical video game written in S running on ZOS")
---
## CONTRIBUTION, WORKFLOW, SOURCE GUIDE
There is no 'c*de of c*nduct'.
The issue/bug tracker is in the 'bug' file. Keeps this project independent from online issue tracking hosts.
Filemap:
.
├── README.md -- this file
├── bug -- bugs & issues go here
├── c.sh -- compiling script
├── main.c -- the entire source code
└── zos -- emulator executable
1 directory, 5 files
run ``./c.sh`` to compile the simulator.
run ``./c.sh X86`` to compile a bootable x86-64 image.
run ``./c.sh DUINO`` to compile for arduino.
Importance scale in issue tracking
1 - last concern
2 - important
3 - right now!
## STATUS
ZOS is under heavy construction, at this point it is a proof of concept.
## PHILANTHROPY
_official ZOS donation fund_
Monero (XMR): 48Sxa8J6518gqp4WeGtQ4rLe6SctPrEnnCqm6v6ydjLwRPi9Uh9gvVuUsU2AEDw75meTHCNY8KfU6Txysom4Bn5qPKMJ75w
Wownero (WOW): WW2L2yC6DMg7GArAH3nqXPA6UBoRogf64GodceqA32SeZQpx27xd6rqN82e36KE48a8SAMSoXDB5WawAgVEFKfkw1Q5KSGfX9
If you have philanthropic interest in ZOS, contact Vilyaem.
---
## LICENSE
``
CHRISTIAN FREE SOFTWARE LICENSE
CFSL
This software is free and open source charity ware, users are asked
to donate to the Eastern Orthodox Church by any means.
Redistribution of this project in source and/or binary forms with/without
modification, are permitted provided that the following conditions are met:
1. Redistributions must retain this notice, the conditions, and the disclaimer.
2. Redistributions must retain credit to the author, and signage to where the original
work can be found.
3. Redistributions cannot become a part of, in anyway shape or form, part of proprietary
software, or software that is clearly out of line with Christian values.
4. Redistributions must remain free, both in price, and what users may do with the software,
the software must remain public and easily accessible.
DISCLAIMER
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
``

9
bug ノーマルファイル
ファイルの表示

@ -0,0 +1,9 @@
14
1 3 Not done Fix loops in S? S seems to have some loop bugs, investigate this further, I think the state-machine-like\nway of handling loops is interesting.
2 3 Not done Finish core, finish emulator. \nFinish the emulated operating system.\n\nS - 8/10\nVedlin - 9/10\nKernel/libc - 1/10\nGraphics 0/10\n\nFor now we dont need to implement IO to disk, everything is temporal.
0 3 Done! Make vedlin use filesystem functions Vedlin is reimplementing functionality that should really be handled by the filesystem?
5 3 Done! Prompts are broken? \nWhen working on the Vedlin editor I notice that it will ask for a line number\non some operations, but will not ask the user for a string, this could be associated with the\nCIA and MIT bugs.\n\nSOLVED: scanf and fgets just mess each other up
4 3 Done! bugs caused by CIA and MIT For the past day and a half I have been scratching my head on a segmentation fault\nsupposedly caused by a call to strcpy, sounds like a trivial problem, but it turns\nout that is not the case, I thought it was related to scoping, it was not that either,\nwhen I switched compilers to TCC, tcc does not like having variable declarations in\nswitch cases, so after fixing them the program works just fine, on gcc it\nalways crashes. 'cproc' with its QBE backend never finishes compiling, qbe just\nperpetually hogs 100% CPU in the background. Must a combination of weird bugs that\nnestle in perfectly with minute compiler bugs. \n\nsolution: write your own compiler and assembler and or abstract stuff that could be\ntripping up\n\nGCC sucks\nGDB sucks\nTCC sucks\nQBE sucks\nLinux sucks\n\nSOLVED: This seems to have fixed it self, bad libc usage???
10 1 Not done Implement graphics into S \nUse SDL2 for emulator, VGA for x86, and some standard text buffer for arduino.\nThis requires implementation of built-in function calling. The Operating System,\nif it uses color, will at most be 640x480 16 color.\n\nFunctions required\n\n\n::GR_INIT -- intialize graphics\n::GR_CLR -- Clear the screen\n::GR_SETCOL -- Set color to stackptr-1(1-16)\n::GR_PLOT -- Plot pixel, stackptr-2(x) stackptr-1(y)\n::GR_SPR -- Draw a sprite in RLE 16 color, all sprites are square resolution, stackptr-1 is res, the rest is data\nuntil you hit -1
11 3 Not done Add string pushing. \nAdd the ability to push an ASCII string onto the stack.\n\nLike this\n\n."Hello World"
9 3 Done! Vedlin and VedlinWriteFile bugs \nThe first byte of 'vedfilename' is somehow becoming a newline?\nIs this a libc issue?\n\nThe first byte of 'strbuf' is becoming null, I dont think I am \ncomposing a string array into a single stringe seperated by newlines \ncorrectly.\n\nVedlin Load File also seems broken.\n\nIf these bugs are fixed then ZOS can be considered finished as a proof of concept.\n\nSOLVED:\n\nThis involved a big rewrite, also just removing some bad code.

4
c.sh 実行可能ファイル
ファイルの表示

@ -0,0 +1,4 @@
#!/bin/sh
rm zos
cl
gcc -g -O3 -std=c89 -Wall main.c -o zos && ./zos

4
config ノーマルファイル
ファイルの表示

@ -0,0 +1,4 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true

547
main.c ノーマルファイル
ファイルの表示

@ -0,0 +1,547 @@
/*********************************************
* Description - ZOS Operating System
* Author - Vilyaem
* Date - Apr 02 2024
* *******************************************/
/*----------PREPROCESSOR----------*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*S language*/
#define LOOP_FINISHING 1
#define LOOP_HARDLOOP 3
#define LOOP_HARDLOOP_IDLE 5
#define LOOP_NOLOOP 0
#define LOOP_TEMPLOOP 2
#define LOOP_TEMPLOOP_IDLE 4
#define SMAXCNT 64
/*MiniFS*/
#define MINIFS_MAXNAMESIZE 16
#define MINIFS_MAXBYTESIZE 32768
#define MINIFS_MAXFILES 16
/*Vedlin*/
#define VEDMAXCNT 128
/*----------DATA STRUCTURES----------*/
/*--MINIFS--*/
typedef struct{
char name[MINIFS_MAXNAMESIZE];
unsigned char data[MINIFS_MAXBYTESIZE];
}MiniFile;
typedef struct{
MiniFile files[MINIFS_MAXFILES];
int filecnt;
}MiniFileSystem;
/*----------GLOBALS----------*/
MiniFileSystem filesystem;
char hist[SMAXCNT][SMAXCNT];
char interact[SMAXCNT];
char promptbuf[SMAXCNT];
char vedfile[VEDMAXCNT][VEDMAXCNT];
char vedfilename[VEDMAXCNT];
char workspace[SMAXCNT];
int histcnt = 0;
int i,j,k,l;
int ifskip = 0;
int loopend = 0xDEADBEEF;
int loopstart = 0xDEADBEEF;
int loopstatus = LOOP_NOLOOP;
int pnum;
int stack[SMAXCNT];
int stackptr = 0;
/*----------FUNCTIONS----------*/
/*--MINI FILESYSTEM--*/
/*********************************************
* Description - Initialize a file system,
* blank all files.
* Author - Vilyaem
* Date - Mar 08 2024
* *******************************************/
void InitFileSystem(MiniFileSystem* sys){
for(i = 0;i != MINIFS_MAXFILES;i++){
sys->files[i].name[0] = '_';
sys->files[i].name[1] = '\0';
for(j = 0;j != MINIFS_MAXBYTESIZE;j++){
sys->files[i].data[j] = '\0';
}
}
}
/*********************************************
* Description - Create a file,
* given the name, an array of data, and the filesystem.
* Author - Vilyaem
* Date - Mar 08 2024
* *******************************************/
void CreateFile(MiniFileSystem* sys, unsigned char data[], char name[]){
if(strlen(name) > MINIFS_MAXNAMESIZE){
puts("error: filename too long");
return;
}
if(sys->filecnt >= MINIFS_MAXFILES){
puts("error: too many files");
return;
}
strcpy(sys->files[sys->filecnt].name,name);
memcpy(&sys->files[sys->filecnt].data,&data,MINIFS_MAXBYTESIZE);
printf("created file name: %s | data: %s | filecnt: %d\n",name,data,sys->filecnt);
sys->filecnt++;
printf("filecnt now: %d\n",sys->filecnt);
}
/*********************************************
* Description - Get filesystem indice given filename
* Author - Vilyaem
* Date - Apr 10 2024
* *******************************************/
int GetFileIndice(MiniFileSystem* sys, char name[]){
for(i = 0; i != MINIFS_MAXFILES;i++){
if(sys->files[i].name[0] != '_'){
if(strcmp(sys->files[i].name,name) == 0){
return i;
}
}
}
return -1;
}
/*********************************************
* Description - Resort the file system,
* we do this after deleting a file, otherwise we
* will start overwriting stuff.
* Author - Vilyaem
* Date - Mar 08 2024
* *******************************************/
void SortFS(MiniFileSystem* sys){
for(i = 0;i != MINIFS_MAXFILES;i++){
MiniFile swap;
if(sys->files[i].name[0] == '_' ){
swap = sys->files[i];
sys->files[i] = sys->files[i+1];
sys->files[i+1] = swap;
}
}
}
/*********************************************
* Description - Delete a file, given the name and the
* file system
* Author - Vilyaem
* Date - Mar 08 2024
* *******************************************/
void DeleteFile(MiniFileSystem* sys, char name[]){
int getfile = GetFileIndice(sys,name);
if(getfile != -1){
sys->files[getfile].name[0] = '_';
for(i = 0;j != MINIFS_MAXBYTESIZE;i++){
sys->files[i].data[i] = '\0';
}
SortFS(sys);
}
}
/*********************************************
* Description - List files
* Author - Vilyaem
* Date - Apr 04 2024
* *******************************************/
void ListFiles(MiniFileSystem* sys){
for(i = 0; i != MINIFS_MAXFILES;i++){
printf("%d: (%d)\t\t\t\t %s\n",i,sys->files[i].name[0],sys->files[i].name);
}
}
/*********************************************
* Description - Copy contents of a file to another file
* Author - Vilyaem
* Date - Apr 04 2024
* *******************************************/
void CopyFile(MiniFileSystem* sys, char destname[], char srcname[]){
int getfilesrc = GetFileIndice(sys,srcname);
int getfiledest = GetFileIndice(sys,destname);
if(getfilesrc == -1){
return;
}
if(getfiledest == -1){
sys->filecnt++;
memcpy(&sys->files[sys->filecnt].data,&sys->files[getfilesrc].data,sizeof(MINIFS_MAXBYTESIZE));
}
else {
memcpy(&sys->files[getfiledest].data,&sys->files[getfilesrc].data,sizeof(MINIFS_MAXBYTESIZE));
}
strcpy(sys->files[getfilesrc].name,destname);
}
/*********************************************
* Description - Rename file
* Author - Vilyaem
* Date - Apr 04 2024
* *******************************************/
void RenameFile(MiniFileSystem* sys, char newname[], char oldname[]){
int getfileold = GetFileIndice(sys,oldname);
strcpy(sys->files[getfileold].name,newname);
}
/*********************************************
* Description - Write data to a file
* Author - Vilyaem
* Date - Apr 04 2024
* *******************************************/
void WriteToFile(MiniFileSystem* sys, char destname[], unsigned char content[]){
int getfile = GetFileIndice(sys,destname);
if(getfile != -1){
for(i = 0; i != MINIFS_MAXBYTESIZE;i++){
sys->files[getfile].data[i] = content[i];
}
}
}
/*********************************************
* Description - Show a file, like in DOS
* Author - Vilyaem
* Date - Apr 10 2024
* *******************************************/
void TypeFile(MiniFileSystem* sys, char* name){
int getfile = GetFileIndice(sys,name);
if(getfile != -1){
for(i = 0; i != MINIFS_MAXBYTESIZE;i++){
printf("%c",(char)sys->files[getfile].data[i]);
}
}
}
/*********************************************
* Description - Universally prompt the user for a string
* Author - Vilyaem
* Date - Apr 17 2024
* *******************************************/
char* prompt(){
memset(promptbuf,0,sizeof(promptbuf));
int c;
while ((c = getchar()) != '\n' && c != EOF);
fgets(promptbuf,SMAXCNT,stdin);
promptbuf[strcspn(promptbuf,"\n")] = '\0';
return promptbuf;
}
/*--VEDLIN TEXT EDITOR--*/
/*********************************************
* Description - Print out vedlin's buffer
* Author - Vilyaem
* Date - Apr 16 2024
* *******************************************/
void VedlinPrintFile(){
for(i = 0; i != VEDMAXCNT;i++){
if(vedfile[i][0] != '\0'){
printf("%d : ",i);
puts(vedfile[i]);
}
}
}
/*********************************************
* Description - Append to a certain line in vedlin
* Author - Vilyaem
* Date - Apr 16 2024
* *******************************************/
void VedlinAppendFile(){
for(i = 0; i != VEDMAXCNT;i++){
if(vedfile[i][0] == '\0'){
strcpy(vedfile[i],prompt());
break;
}
}
}
/*********************************************
* Description - Vedlin saving
* Author - Vilyaem
* Date - Apr 16 2024
* *******************************************/
void VedlinWriteFile(){
int wrtfile = GetFileIndice(&filesystem,vedfilename);
unsigned char data[MINIFS_MAXBYTESIZE];
if(wrtfile == -1){
puts("The file isnt there");
}
else {
puts("The file is there");
}
/*Format the data*/
for(i = 0; i != VEDMAXCNT;i++){
strcat((char*)data,(char*)vedfile[i]);
}
if(wrtfile != 1){
/*memcpy(&filesystem.files[wrtfile].data,&data,sizeof(MINIFS_MAXBYTESIZE));*/
CreateFile(&filesystem,data,vedfilename);
}
else {
WriteToFile(&filesystem,filesystem.files[wrtfile].name,data);
}
}
/*********************************************
* Description - Load a file from the filesystem
* and put it in vedlin's file buffer
* Author - Vilyaem
* Date - Apr 16 2024
* *******************************************/
void LoadFileVedlin(){
/*Get the file*/
int fileindice = GetFileIndice(&filesystem,vedfilename);
for(i = 0; i != VEDMAXCNT;i++){
/*strcpy(file[i],strtok(filesystem.files[fileindice].data,"\n"));*/
char strbuf[VEDMAXCNT];
sprintf(strbuf,"%s",strtok((char*)filesystem.files[fileindice].data,"\n"));
strcpy(vedfile[i],strbuf);
}
}
/*********************************************
* Description - The vedlin line editor
* Author - Vilyaem
* Date - Apr 16 2024
* *******************************************/
void Vedlin(void){
puts("VEDLIN text editor by Vilyaem 2024 https://vilyaem.xyz thekenyaz@yandex.com\nThis software is CFSL licensed, you should have recieved the license with this program,\nyou can view the license here https://peepsoft.3vm.cl/LICENSE.TXT\n\nq:quit\nw:write\nc:change line\nd:delete line\na:append\np:put file buffer\nk:clear\n\nEnter filename:");
strcpy(vedfilename,prompt());
puts(vedfilename);
/*vedfilename[0] = 'a';*/
/*LoadFileVedlin();*/
while(1){
char operation;
int selectline;
printf("*");
scanf("%c",&operation);
/*operation = fgetc(stdin);*/
switch(operation){
case 'q': puts("Goodbye."); return; break;
case 'w': VedlinWriteFile(); break;
case 'c': scanf("%d",&selectline); for(i = 0; i != selectline - 1; i++){if(vedfile[i][0]=='\0'){vedfile[i][0] = '\n';}}
prompt();strcpy(vedfile[selectline],promptbuf);break;
case 'd': scanf("%d",&selectline); vedfile[selectline][0] = '\0'; break; /* haha! */
case 'a': VedlinAppendFile(); break;
case 'p': VedlinPrintFile(); break;
case 'k': puts("\x1b[H\x1b[J"); break;
default: puts("?"); break;
}
}
}
/*--S PROGRAMMING LANGUAGE & SHELL--*/
/*********************************************
* Description - Push onto the stack
* Author - Vilyaem
* Date - Mar 14 2024
* *******************************************/
void Push(int num){
stack[stackptr] = num;
stackptr++;
}
/*********************************************
* Description - Pop off the stack
* Author - Vilyaem
* Date - Mar 14 2024
* *******************************************/
void Pop(){
stack[stackptr] = 0xDEADBEEF;
stackptr--;
}
/*********************************************
* Description - Setup S Lang
* You can also use this
* to reset everything
* Author - Vilyaem
* Date - Apr 04 2024
* *******************************************/
void SetupS(){
/*Setup stack and history*/
for(i = 0; i != SMAXCNT;i++){
stack[i] = 0xDEADBEEF;
}
for(i = 0; i != SMAXCNT;i++){
hist[i][0] = '\0';
strcpy(hist[i],"hello");
}
}
/*********************************************
* Description - Do it!
* Author - Vilyaem
* Date - Mar 14 2024
* *******************************************/
void Do(char interact[]){
/*Get ready, and add to history*/
strcpy(workspace,interact);
/*If we are skipping an if statement, skip until endif*/
if(ifskip != 0 && strcmp(workspace,"endif") != 0){
return;
}
/*If we have broken out of a loop, skip over statements*/
if(loopstatus == LOOP_FINISHING && workspace[0] != '_'){
return;
}
switch(workspace[0]){
case 'b': puts("Bye."); exit(0); break; /* shutting off */
case 'p': scanf("%d",&pnum); Push(pnum);break; /* pushing number */
case ';': return; break; /* asm-like comments */
case 'i': if(stack[stackptr-1] != 1){ifskip = 1;}break; /* 'if' */
case 'e': ifskip = 0; break; /* 'endif' */
case '!': if(stack[stackptr-1] != stack[stackptr-2]){Push(1);}break; /* != */
case '<': if(stack[stackptr-1] < stack[stackptr-2]){Push(1);}break; /* < */
case '>': if(stack[stackptr-1] > stack[stackptr-2]){Push(1);}break; /* > */
case '=': if(stack[stackptr-1] == stack[stackptr-2]){Push(1);}break; /* == */
case 'd': Pop();break; /* drop */
case '+': stack[stackptr-1] = stack[stackptr-1] + stack[stackptr-2];Pop();break; /* + */
case '-': stack[stackptr-1] = stack[stackptr-1] - stack[stackptr-2];Pop();break; /* - */
case '*': stack[stackptr-1] = stack[stackptr-1] * stack[stackptr-2];Pop();break; /* * */
case '/': stack[stackptr-1] = stack[stackptr-1] / stack[stackptr-2];Pop();break; /* / */
case '%': stack[stackptr-1] = stack[stackptr-1] % stack[stackptr-2];Pop();break; /* % */
case 'k': pnum = getchar();Push(pnum);break; /* key */
case '@': loopstart = histcnt+1; loopstatus = LOOP_TEMPLOOP_IDLE; break; /* @ temporary loop */
case '&': loopstart = histcnt+1; loopstatus = LOOP_HARDLOOP_IDLE; break; /* & hard loop */
case '{': loopstatus = LOOP_FINISHING; break; /* { breaks */
case '_':
loopend = histcnt;
if(loopstatus == LOOP_HARDLOOP_IDLE){
loopstatus = LOOP_HARDLOOP;
while(loopstatus != LOOP_NOLOOP){
for(i = loopstart; i != loopend;i++){
Do(hist[i]);
}
}
}
if(loopstatus == LOOP_TEMPLOOP_IDLE){
loopstatus = LOOP_TEMPLOOP;
while(loopstatus != LOOP_NOLOOP){
for(i = loopstart; i != loopend;i++){
Do(hist[i]);
if(stack[stackptr-1] == 1){
loopstatus = LOOP_NOLOOP;
break;
}
}
}
}
break; /* _ marks end of loop */
/*Special dot commands*/
case '.':
switch(workspace[1]){
case 's': /*.s prints the stack */
printf("STACK:");
for(i = 0;i != SMAXCNT;i++){
if(i == stackptr){
printf("->");
}
printf(" %d:",i);
if(stack[i] != 0xDEADBEEF){
printf(" <%d> ",stack[i]);
}
else{
printf(" <NULL> ");
}
}
puts("");
break;
case 'p': /* print value as ASCII and pop*/
putchar(stack[stackptr]);
Pop();
break;
case 'c': /*.clr clears the stack and sets stackptr to 0*/
SetupS();
break;
case 'h': /*.hist shows history*/
for(i = 0; i != SMAXCNT;i++){
if(hist[i][0] != '\0'){
printf("%s\n",hist[i]);
}
}
printf("histcnt: %d\n",histcnt);
break;
default: /* . just prints and pops */
printf("%d\n",stack[stackptr]);
Pop();
break;
}
/*ZOS specific commands*/
case '$':
switch(workspace[1]){
case 't': /* $type a file */
TypeFile(&filesystem,prompt());
break;
case 'd': /* $delete a file */
DeleteFile(&filesystem,prompt());
break;
case 'v': /* $vedlin */
Vedlin();
break;
case 'c': /* $copy a file */
CopyFile(&filesystem,prompt(),prompt());
break;
case 's': /* $save the system to disk */
/*SaveToDisk();*/
break;
case 'l': /* $list files */
ListFiles(&filesystem);
break;
}
}
/* handle stack being broken */
if(stackptr <= -1){
puts("STACK UNDERFLOW");
SetupS();
stackptr = 0;
}
else if(stackptr > SMAXCNT){
puts("STACK OVERFLOW");
SetupS();
stackptr = 0;
}
puts("ok");
printf("-> %d\n",stackptr);
}
/*----------ZOS OPERATING SYSTEM----------*/
/*********************************************
* Description - Main
* Author - Vilyaem
* Date - Apr 02 2024
* *******************************************/
int main(void){
InitFileSystem(&filesystem);
SetupS();
puts("ZOS by Vilyaem (https://vilyaem.xyz thekenyaz@yandex.com)");
while(1){
printf("?>");
Do(prompt());
}
return 0;
}

15
x86boot.asm ノーマルファイル
ファイルの表示

@ -0,0 +1,15 @@
;NASM X86 bootloader
BITS 16
org 0x7c00
mov ax, 0
mov es, ax
mov ah, 0x02 ; Function: Read Sectors From Drive
mov al, 1 ; sector count
mov ch, 0 ; cylinder
mov cl, 2 ; sector
mov dh, 0 ; head
mov bx, 0x500 ; destination addess
int 0x13
jmp 0:0x500
times 510 -( $ - $$ ) db 0
db 0x55, 0xaa

バイナリ
zos 実行可能ファイル

バイナリファイルは表示されません。