#NostaluxOS

1 messages ยท Page 1 of 1 (latest)

split hare
#

This is my first operating-system project

split hare
#

did some changes to the start screen

#

added some commadns

#

trying to add a filesystem to the OS

split hare
#

system fault

#

triple fault

split hare
#

lots of bugs

split hare
#

check_exception old: 0x8 new 0xd
Triple fault

split hare
#

fixed triple faulyt

#

fault

split hare
#

file system implemented

#

The NostaluxOS architecture is designed for retro-minimalism running on modern 64-bit

  1. Core Architecture
    64-Bit Long Mode: This core creates a dedicated 64-bit environment (entry.asm, stage2.asm), utilizing Paging and the Global Descriptor Table (GDT)
    Custom Two-Stage Bootloader: A handcrafted assembly bootloader (MBR -> Stage 2) that manually loads the kernel payload from disk sectors, enables A20, and transitions CPU modes.
    Ring 0 :The kernel currently operates entirely in Ring 0 (Supervisor Mode), granting it absolute control over all hardware resources.

  2. Shell and Visuals
    Retro-Console Shell:An interactive command-line interface (shell.c) capable of parsing user inputs and executing system binaries.
    VGA Text Mode Engine: 80x25 character display with 16 foreground/background colors.
    Dynamic Theming: The color and palette commands allow runtime modification of the visual environment.
    ASCII Aesthetics: Includes a rendering engine for the "Nostalux" banner and grid background upon boot (background.c).

  3. Storage
    In-Memory Volatile FS: A lightweight, RAM-resident filesystem (fs.c).
    File Manipulation: Supports creating (touch), reading (cat), writing (write), appending (append), and deleting (rm) files.
    WARNING: this storage is non-persistent. Rebooting purges the datastream.

  4. System Utilities
    Command History: The system tracks the last 16 commands entered, accessible via the history command or Up/Down arrow keys (keyboard.c).
    System Profiler: The sysinfo command reports detected memory usage and architecture details.
    Kernel Logging: A circular debug buffer (syslog.c) accessible via the logs command, tracking system events and boot milestones.

worn schooner
#

For how long have you been working on this?

#

and is it opensource?

warped canyon
#

cool, btw will be there an uefi bootloader

split hare
#

its been like a week or 2 but i was using codex

#

i stopped using it

#

now im just using the web editor on github

#

and it is on github

#

its open source

warped canyon
#

give a link

worn schooner
#

Yeah, give us the link

split hare
#

@warped canyon @worn schooner im changing from polling to interrupt

split hare
#

@worn schooner donme

#

done

worn schooner
#

cool

split hare
#

what should i add next

worn schooner
#

ACPI?

#

if you don't have it yet

split hare
#

i want to work more on ram and filesystem

worn schooner
#

oh get the filesystem done first, i mean that's what i would do

#

Do you have the basic systems like time?

split hare
#

no

#

@worn schooner send link

worn schooner
#

link of?

split hare
#

The implementation is located in kernel/shell.c CMOS chip using I/O ports 0x70 and 0x71 to read the BCD values for seconds, minutes, hours, day, month, and year

#

@worn schooner OS

worn schooner
#

my own OS?

#

@split hare

split hare
#

yes

worn schooner
#

the OS is very unorganized and very basic

split hare
#

nice

#

what does it currently do

worn schooner
#

sooo it has a game, a single snake game

#

but after making the OS 64-bit it bugged out so it's to be fixed after PIT

#

it has a small shell with few commands

#

kernel panic screen

#

just the basic ones to be honest

split hare
#

@worn schooner i will checjk

#

you ahve a monolithic kernel loaded via the Limine bootloader

#

@worn schooner 1. Remove the infinite tick-printing loop so the shell can start
2. Mask IRQ1 on the PIC. This prevents the keyboard from firing interrupts allowing your shell.c polling logic to read keys safely without crashing the CPU

#
#include "core/software/shell.h"
#include "core/PIT.h"
#include "core/idt.h"
#include "drivers/panic.h"
#include "drivers/hwinfo.h"
#include <limine.h>

void delay(int count) {
    for (volatile int i = 0; i < count; i++);
}

void kmain() {
    init_framebuffer();

    if (memmap_request.response == NULL) {
        print_string("Memmap not available!\n", 0xFFFFFFFF);
        kpanic("NO MEMMAP");
    }

    print_memmap();
    print_string("\n", 0xFFFFFFFF);
    print_memory_info_detailed();
    print_memory_info();
    //pit_init(1000);    

    print_string("ShadeOS x86_64 Pre-release!\n", 0xFFFFFFFF);

    
    pic_remap();
    idt_init();
    pit_init(1000);
    asm volatile("sti");
    uint64_t time = 0;
    char buf[64];
    while (true) {
        uint64_t t = get_ticks();
        int_to_string(t, buf);
        print_string(buf, 0xFFFFFFFF);
        print_string("\n", 0xFFFFFFFF);
        delay(5000000);
    }

    shell_loop();

    for (;;) {
        asm("hlt");
    }
}
#

this is your kernel.c

#
#include "core/software/shell.h"
#include "core/PIT.h"
#include "core/idt.h"
#include "drivers/panic.h"
#include "drivers/hwinfo.h"
#include <limine.h>

void delay(int count) {
    for (volatile int i = 0; i < count; i++);
}

void kmain() {
    init_framebuffer();

    if (memmap_request.response == NULL) {
        print_string("Memmap not available!\n", 0xFFFFFFFF);
        kpanic("NO MEMMAP");
    }

    print_memmap();
    print_string("\n", 0xFFFFFFFF);
    print_memory_info_detailed();
    print_memory_info(); 

    print_string("ShadeOS x86_64 Pre-release!\n", 0xFFFFFFFF);

    pic_remap();
    idt_init();
    pit_init(1000);
    
    // Mask IRQ1 (Keyboard) to prevent crash on keypress.
    // Since shell.c uses polling, we don't want the CPU to jump 
    // to an interrupt handler (which doesn't exist yet) when a key is pressed.
    port_byte_out(0x21, port_byte_in(0x21) | 0x02);

    asm volatile("sti");

    // --- REMOVED BLOCKING LOOP HERE ---
    // The old loop prevented shell_loop() from ever running.
    
    shell_loop();

    for (;;) {
        asm("hlt");
    }
}
worn schooner
#

๐Ÿ‘

#

I'll do that tomorrow

split hare
#

begun work on gui

worn schooner
#

Cool

split hare
#

@worn schooner did u fix

worn schooner
#

I started rewriting the whole interrupt and apparently i just finished writing IDT and working on PIC then IRQ

split hare
#

nice

worn schooner
#

#1433902427740049610

exotic panther
#

nice, did you share source code yet

worn schooner
split hare
#

currently trying to get gui to work

#

I moved from polling to interrupt

#

and implemented ata

split hare
#

my next plan is to have a working gui

wet knot
#

So it might be better to reach userspace before starting with gui

split hare
#

yeah i should switch to ring 3 instead of ring 0

wet knot
split hare
wet knot
split hare
#

yeah i need to switch from static allocations ๐Ÿ˜ญ

#

to dynamic

sour pivot
#

bruh

split hare
#

im going to be redo gui.demo.c to use linked lists and kmalloc instead of static array

split hare
#

@sour pivot im going to switch to ring 3 first

#

for userspace gui

#

instead of ring 0

sour pivot
#

yeah, then you need malloc too

split hare
#

my gui is in kernel mode lol

#

but its really basic

exotic panther
#

windows has a kernel based windowing system

split hare
#

@sour pivot @wet knot

#

implemented kmalloc

#

and a scheduler

worn schooner
#

Which is a big problem but its just for the sake of backward compatibility

exotic panther
#

only signed drivers can run in kernel space, these anticheats just bundle a signed driver with an ioctl like interface

worn schooner
#

Are you sure about that? Well maybe i heard a wrong news, ive also heard that the gui runs on kernel space

worn schooner
#

I see ๐Ÿ‘€, how about the gui?

uncut timber
#

and most people agree that was a mistake

worn schooner
#

Yeah since it can take down the whole OS

exotic panther
#

cant really do DirectX without it

#

anyone else remember gaming on NT 4 and even 2000? with its "you need 2x as much ram, and there will be a massive reduction in performance"

uncut timber
#

I mean, didn't those two already have win32k.sys?

split hare
#

nostaluxOS is now ring 3 for the graphical

#

but there some bugs i need to fix

wet knot
split hare
#

I am building the next temple

#

this temple will have networking

wet knot
split hare
wet knot
#

TempleOS

#

`?

split hare
#

@wet knot yes

#

holyC v2.0 will replace C

#

Desecrating the Altar is the first sstep

exotic panther
#

lol

#

isnt this kinda like peeing on a dead mans grave

split hare
#

I have gui fully functional

#

working in ring 3

wet knot
worn schooner
#

Yes, let's see

split hare
#

@wet knot @worn schooner

#

whats ur time

split hare
#

im further upgrading the gui

split hare
wet knot
#

in one day?

#

How is that even possible?

#

Well wow, it has been a while since I've seen an whole AI generated OS.

#

Damn

#

It's sad seeing though, so much opportunities to learn, so much knowledge all gone.

worn schooner
worn schooner
#

This was so fast, for me implementing the interrupters alone took me 2-3 days

wet knot
#

It is overly commented, it has comments like "Fixed {issue} by doing {overly detailed explanation}". Everything with extreme SPAG and the files are 1k lines each. All without any proper structure inside a single folder.

#

I'm not judging him for using AI, just that for me I feel like it's so much knowledge lost and for me this project is not worth looking at.

worn schooner
#

gui_demo.c consist of syscalls? Interesting...

wet knot
worn schooner
#

Oh my

#

I spotted a function that's specifically for handling browser's click

#

System calls as well

#

This all in gui_demo.c

wet knot
worn schooner
#

When i first tried to make an os I had to search "how to make windows" and yes english is not my first language. There were no Ai so learning such a thing was much harder (it was pre covid)

wet knot
worn schooner
sour pivot
#

or if you wanna search inside a big doc

wet knot
worn schooner
#

No!

sour pivot
#

it could theorically work

#

just idk what it would spit out

worn schooner
#

I mean asking Ai about some specific part let's say you want to implement PIT, you dont ask it "make me a PIT for my OS" you ask it to describe it and then later when you check the osdev PIT page, its going to be easier for you to understand

wet knot
worn schooner
#

AI is not capable of making an OS

wet knot
#

This is what it would spit out.

sour pivot
#

it is

wet knot
#

This OS is completely AI made.

sour pivot
#

the agentic mode should be able to somewhat do it

#

with a bit of help

worn schooner
# sour pivot it is

I have tried making a simple Minecraft 2d game with pygame as a challenge a year ago and it didnt go well

sour pivot
#

i made it do my elf loader bc i felt too lazy to write

#

and from what i can see, it should be correct

#

and integrated correctly with my os

wet knot
#

Like this OS is completely AI generated.

worn schooner
#

I have tried making an OS before with gpt 3, and it ended up bad

sour pivot
#

bruh what

worn schooner
sour pivot
wet knot
#

@split hare what AI did you use for this OS?

worn schooner
#

Im in third world country, most of the AI's doesnt work here

sour pivot
#

USA?

worn schooner
#

Just chatgpt, deepseek and Gemini and from what I can tell deepseek performs better still not that good

worn schooner
sour pivot
#

i remember some ppl said it became one

worn schooner
#

Anyways my point is you can use AI to describe how some part of something works just not "make something"

sour pivot
#

it can make something from scratch

worn schooner
sour pivot
#

tho you have to describe it VERY well, and help sometimes

worn schooner
sour pivot
#

and use agents to write code

worn schooner
sour pivot
#

yep

cosmic needle
# sour pivot it can make something from scratch

This is misleading. It can't "create". It can however regurgitate the contents of really bad internet tutorials, like half incorrectly, and then generate you a readme with a bunch of emojis on a bulleted list talking about how blazing fast and modern it is

#

That's what happens to people who try to AI generate an OS

sour pivot
#

depends what AI you use

#

some AIs are now being trained on actual production code

#

basically some devs are getting hired to create some real production code to train AIs on

cosmic needle
#

They've been doing that for years lol

worn schooner
#

Pretty sure at least 30% of black ops 7 is written with AI. Since it didn't bother them to put AI generated banners

cosmic needle
#

I would never ever trust them with program generation

#

Even if I could I still wouldn't because I actually enjoy things and am not a society-polluting bloodsucking productivity demon lizard person with no soul

sour pivot
#

(and big corps said the AIs will replace devs)

cosmic needle
#

The big corps are evil

#

and have trillions invested in AI

#

so yeah they'd say that

sour pivot
#

and then the "AI Devs" nuke amazon and microsoft

worn schooner
#

I don't think it's as satisfying as getting something to work by yourself

cosmic needle
#

It also makes you stupid

worn schooner
cosmic needle
worn schooner
split hare
#

Okay okay this os is purely ai generated

#

But im just finding out how far an ai can go

#

With building such a project

cosmic needle
#

And that it's not getting any better from here with current knowledge

worn schooner
split hare
#

Are u impressed

#

Of what the ai did

worn schooner
#

Kind of

cosmic needle
#

Lol

#

It's very trivial

#

They've been able to do this for like 2 years already with no improvement

#

We've seen a million AI generated projects almost identical to this

worn schooner
#

Plus AI's wasn't allowed in my country until 2024

split hare
#

ai built this from scratch\

#

it did not need any help

#

It did it without needing to do ANY work

#

it was purely ai generated

#

the dynamic memory, gdt, gui, ring 3, everything

#

it is just ai

#

i didnt even review the changes

wet knot
split hare
#

@wet knot everything it was hitting it

wet knot
#

You dont know what it does

#

and its shitty code

#

which dosent work

#

it simulates everything

#

no ipc

#

no real userspace impl

#

so you think it works

#

but really its just a big if else statement

split hare
#

i literally didnt check the code

#

its not a serious project

wet knot
#

im amazed how far it has come

#

but fr this project is trash, both you and me can say so

split hare
#

that was the goal of it

#

to see how far it can go

#

but yes it is trash

#

its not even a real filesystem

#

But at least it was able to make a nice bootable gui

#

its really impressive

#

because years ago ai would not even be able to boot it

#

damn its really trash

#

its not even real ring 3 ๐Ÿ˜ญ

sour pivot
#

loool

split hare
#

its running on one single kmain

sour pivot
#

so it's just a kernel gui

split hare
#

it didnt even properly implement a scheduler and ipc

#

thats crazy

#

yeah its just a kernel gui with thousands of lines of code

#

@wet knot the ai was hallucinating bruh

worn schooner
wet knot
#

Thats what im saying

split hare
#

it literally said it was ring 3 ๐Ÿ˜ญ

worn schooner
#

I have also made an OS that runs apps with if statement (back in 2023)

worn schooner
split hare
#

LOL

#

UI would have slapped in 2005

worn schooner
#

Oops sorry for the ping

exotic panther
#

I also have used AI sometimes.
to make docs. to help with drivers and collating reference manuals

#

and even tried to get it to make programs in retro rocket basic (it sucks at this)

#

and, to identify bugs

#

don't let it fix them, but it seemed good at finding them

#

I don't use any agentic bullcrap or any integrated coding ones. just ChatGPT plus.

worn schooner
#

I use it when the error is too long and unreadable so it points it out for me

split hare
#

I am no longer going to change the code

#

this project is officially closed

#

im going to be starting a real non-ai generated project

#

should i just make a new thread?

sour pivot
#

yes

split hare
#

im just gonna overwrite the intro