#saalty's unnamed OS

1 messages ยท Page 1 of 1 (latest)

still pebble
#

Hello, I have recently been putting a lot of work into my OS, so much so that I wanted to do progress reports here. For context, it is 64-bit, was microkernel-based but now is different, has software context switching, virtual memory allocation with de-allocation, userspace, processes (I call each background helper process a service/module), Linux-like logging, queue-based PS/2 (soon to be USB) input system, works fully on real hardware with it's own bootloader, a full graphics library for the OS, and is public domain

bitter echo
#

Always cool to see stuff that runs on real hardware, shame about the closed source nature though.

still pebble
#

Yeah, I will probably change my mind about the closed source decision.

#

It's not mature enough for me to confidently to say what it will be

#

tbh, I mainly decided on it because I am afraid my code is pretty ugly

#

alright it's public domain now

#

normally I wouldn't change my mind so fast, but I was unsure of it being proprietary myself

#

anyways, lets get to my OS's goals

#
## Goals for my OS:
# 1. USB
I plan on adding EHCI support soon.
# 2. Games
I am planning on porting some 3d games to it, with my half-assed OpenGL 3.3 implementation.
# 3. Compatibility
I will add PE-64 (is this how you call it?) file loading and ELF64. 32-bit programs will not be able to run in this OS.
# 4. Window manager
I will replicate how Android looks.
# 5. File system
I will try making this OS have no file system :)
#

So right now I am working on adding a nice temporary WM.

#

I could also add a mouse service while I am at it.

#

also, here is a random screenshot of it on real hardware

still pebble
#

Now I have to decide whether I want a terminal or not.

still pebble
#

just experienced this weird bug when attempting to print keyboard input

#

Jesus fucking christ, this bug is scary debugging-wise

#

The actual text rendering seems fine

#

What in the fuck

#

How does it mess up that beautifully

#

Also I have to fix logging it seems

soft solar
#

Is your OS using long mode?

#

or protected mode

still pebble
#

Yup, long mode

soft solar
#

Interesting project, will check out the Github

still pebble
#

Alright!

#

Do note that some parts of the code may be slightly off.

#

Just confirmed that the OS still works on real hardware, awesome

#

Also sorry for my blurry lens

soft solar
#

seems cool

proud pecan
#

nice

still pebble
#

thanks

#

I will be taking a 1 day break from this project, so see you till then!

still pebble
#

Is it worth it to implement AHCI?

#

I am thinking of implementing it over using ATA PIO to read

unborn forge
#

ATA PIO doesn't exist anymore on real hardware and even when it did, it was piss slow

#

i would suggest NVMe as an alternative to AHCI

#

it's very common now and writing a driver is simpler than for AHCI

daring citrus
#

ahci is still very common, so i would say its worth supporting if you want to cover a wider range of today's hardware

#

obviously nvme is superior, mainly because of the speeds, but hard drives are still the king for price/size ratio and i dont think sata will go anywhere anytime soon

unborn forge
#

they will

still pebble
#

Alright, I don't have an NVMe drive anywhere, so i guess AHCI is my best option then.

#

I only have SATA drives

daring citrus
# unborn forge they will

i mean nvme drives are really affordable but i still can get an hdd twice the capacity for the same/slightly lower price, ~300 usd for 4tb nvme and ~250 usd for 8tb hdd

#

gen 3 nvmes are slightly cheaper at around ~250 usd for 4tb

#

but im still not sure how i feel about solid state drives for archiving purposes

still pebble
#

I personally wouldn't call over 75 dollar drives affordable lol

daring citrus
#

it all comes down to price/gb imo

#

no point in buying 4 $75 drives when i can buy a $250 one and have 4 time the capacity in a single drive

#

and the $250 one has a better price/gb ratio, so you get more for less, technically

#

its just that you pay more to get more, obviously

still pebble
#

I'm just saying, I never needed more than 500 gigs ๐Ÿ˜„

daring citrus
#

๐Ÿ˜ฌ

still pebble
#

I am not hoarding data at all, so I have used around 200 gb so far lol

#

But, I am getting an NVMe drive in a few days

#

Because it looks like AHCI is quite similar to EHCI, and I do not like EHCI

#

One quick look at the NVMe osdev wiki page shows that yeah, I will have a lot more fun with NVMe

daring citrus
#

AHCI is pretty simple, idk how EHCI works at all but given its usb i wouldnt expect it to work anything like that

#

interesting

#

qemu also knows how to emulate NVMe so that should help ๐Ÿ˜„

still pebble
#

Yeah, thank god qemu has NVMe emulation

#

wait, what am I doing, I can start writing the driver right now then ๐Ÿ˜„

still pebble
still pebble
#

this is pretty funny

#

Javascript is the last language I would use for osdev

#

I also sadly caught a cold so development will be slow for a few days

still pebble
#

alright, now I have an NVMe drive

shut shoal
#

50% memory usage at idle

still pebble
#

Lmao

#

NVMe fully working on my machine

#

It's driver time

still pebble
#

Thanks, Windows! Now I can make a GPU driver for an RTX card ๐Ÿ˜Ž

#

also, havent done any progress on the OS so far because the cold I caught requires that I take a lot of rest

#

In a few days I'll start with making an NVMe driver

still pebble
#

ah fuck it, I'll start making it right now. I'll document my progress.

#

Right now, I am making a brute force PCI scanner for NVMe devices because I am lazy

#

Alright, NVMe device successfully found on PCI

#

Now to test if it finds my actual NVMe on real hardware

#

Phew, I think it found it

#

Alright, next step is uh

#

This probably is going to be the least fun step

#

Busmastering DMA enabled I think

#

god I am such a noob

#

But I believe in my ability to learn

still pebble
#

alright, really liking my progress so far, I have calculated the max page size for an NVMe controller

#

this is not too bad

#

It always feels nice when specifications start to make sense ๐Ÿ˜„

#

Now the controller is reset

still pebble
#

Alright, here is the exciting part, I am at the point where I can enable the controller

#

Getting really close to having a somewhat capable NVMe driver

#

well, somewhat close

still pebble
#

Phew, moment of truth, time to send a read sectors command. My I/O queues are set up

still pebble
#

This really sucks, I have to apparently use IOAPIC as well

#

And apparently I could have to parse AML

#

This is so sketchy

#

I am actually angry

#

But looks like NVMe drives don't even need IOAPIC to be initialized

#

Thank god

bitter echo
#

You shouldn't need pin based interrupts for nvme

#

I remember the spec strongly recommends msix (and msi as a fallback)

still pebble
#

Yeah I now use msi-x

#

But I don't see the opcode for the read command anywhere in the specs

#

Oh, a little ctrl-f shows it's 0x2

bitter echo
#

ah yes, so for the IO queues you'll want to reference the NVM command set spec

still pebble
#

yup

#

I cant see where I select the namespace to use for the read

#

Maybe I need to set it when creating my I/O queues?

bitter echo
#

There's a field called nsid, it's used for most commands so I think it's listed under the generic command structure

#

it was dword 1 or 2 from memory

still pebble
#

oh yeah, dword 1, alright

still pebble
#

ah crap, I implemented 2.0 spec instead of 1.4

#

and qemu is 1.4

still pebble
#

also - am I calculating my 64-bit bar0 correctly?

uint64_t bar0 = ((uint64_t)pci_header.BAR0 & 0xFFFFFFF0) | ((uint64_t)pci_header.BAR1 << 32);
#

I have a feeling that I am not even communicating with the NVMe controller

#

because read command is not doing anything

still pebble
#

Finally, NVMe Identify command is working!

#

Only took 17 continuous hours!

#

I am really proud of myself

#

Now I have to fix the read command and then I can take a well-deserved break

still pebble
#

How the hell does my OS work on real hardware but not on emulator

#

The emulator in question is Virtualbox

misty token
#

that can happen quite often

proud pecan
#

or restarts

#

I don't know yet

still pebble
proud pecan
#

that's a good point

#

it's practically a breakpoint

still pebble
#

yup

still pebble
#

I really done just spilled water on my computer

#

I would've done osdev if now I didn't have to wait for it to dry

#

And my USB stick that I copy my OS to might be fucked

#

And my drives... might be fucked too

livid summit
still pebble
#

Is it an assembly instruction?

livid summit
#

no its a gdb command

still pebble
#

break is pretty nice, but in cases where you cannot connect to gdb you might have no other choice than cli hlt

livid summit
#

why would you not be able to connect to gdb

still pebble
#

Real hardware I guess

#

I am not sure whether VirtualBox has gdb support too

still pebble
#

Computer is running fine it seems

still pebble
#

Installing Gentoo, so I will not be osdeving for a day or two

#

It's been a long break but I'll be back soon

#

I don't know why I bother to even say that, no one cares lol

unborn forge
#

my condolences

still pebble
#

Alright, gentoo installed, time to migrate my OS to this gentoo installation

still pebble
#

But first some Rocket League

#

ADHD moment

still pebble
#

I have not given up on this OS, I will start work on the nvme driver again today

#

Good thing with Linux I can just mount my drive where my OS is stored and just copy it over to my Gentoo installation

#

Okay now I have it on Gentoo

#

Great

#

Now I only have to install Qemu then off to debugging

still pebble
#

I'm back, so the nvme driver still doesn't work

#

After weeks of debugging

#

It'll be easy they said

#

At least I can send admin commands successfully, not IO though

still pebble
#

FINALLY IT WORKS

still pebble
#

FUCK YEAH

#

Now making my own file system, which is the logical next step

sharp glade
#

OR a driver for an existing fs design

still pebble
#

No, I want to be unique

#

It's great fun designing a fs

soft solar
sharp glade
#

by knowing what the goals are

#

and having a toolbox of knowledge about data structures and which ones best apply to disks and stuff

livid summit
#

90% of the time someones "own file system" ends up being fat with a couple minor changes

still pebble
still pebble
sharp glade
still pebble
#

Alright guys, should I port DWM directly or Xorg first

#

After the filesystem

livid summit
#

do you have a shell yet

still pebble
#

Yes

worthy jasper
#

just dwm

#

why adhere to the xorg spec when you can just hack together your own implementation of whatever the fuck you want B)

#

as long as you understand it, it's all good

still pebble
#

Yeah I'll just port DWM directly

#

But right now, I have a filesystem which supports directories of any size and any depth

#

Adding files soon

#

My brother actually made me a background which will be the default background for this OS

unborn forge
#

that's actually pretty

still pebble
#

Yeah ๐Ÿ˜„

unborn forge
#

reminds me of windows vista

still pebble
#

Yup, I think instead of embedding the background image in the OS, I will just write some file manager tool for Linux that can add files to my filesystem, like this background

still pebble
#

๐Ÿ˜„

still pebble
#

Now I cannot test my OS on real hardware because I don't want to overwrite my very important nvme drive

still pebble
#

File read/writing almost done in my filesystem driver, soon I will make an ls, cat, and a little makeshift nano

#

Oh, and touch and rm

#

Mkdir

#

Wow, already have a ton of possibilities

still pebble
#

Latest progress, getting closer to linux

#

There is also a recursive remove command which I am proud of

worthy jasper
#

nice work ๐Ÿ˜Ž ๐Ÿ‘

still pebble
#

Thanks!

#

Another example

worthy jasper
#

ahh, nice!

just curious, how's the work on your version of nano / a text editor going?

still pebble
#

I haven't done work on it yet, however I plan for it to be finished tomorrow when I wake up ๐Ÿ˜„

worthy jasper
#

o7

still pebble
#

Github updated

proud pecan
#

I have a name: SaltyOS

still pebble
proud pecan
#

THEOS, which translates from Greek as "God", is an operating system which started out as OASIS, a microcomputer operating system for small computers that use the Z80 processor. When the operating system was launched for the IBM Personal Computer/AT in 1982, the decision was taken to change the name from OASIS to THEOS, short for THE Operating Sy...

#

TheOS is already taken

still pebble
proud pecan
#

Ok then

still pebble
#

I am soon going to make a text editor now which will be pretty exciting, but first cat command

still pebble
#

Okay guys, time to test my OS on bare metal.

#

I moved my important files out of my NVMe drive.

#

Page fault!

#

Uh oh

#

And when I remove the NVMe initialization it works

#

Well, not disk io of course, but everything else works

#

This will be a long night

#

Of debugging

worthy jasper
#

good luck! o7

#

happy hacking :)

still pebble
#

๐Ÿ˜„๐Ÿ‘ This definitely will be fun

still pebble
#

Okay, fixed page fault!

#

Now I am close to getting it working on real hardware

soft solar
still pebble
soft solar
#

ah

still pebble
#

Ah! I think it's not working because I forgot to align my data structures to the NVME controller's page size

#

Nope

#

I will create a debug kernel log function for convenience

still pebble
#

It's been like 3 hours of debugging so far, but making amazing progress

still pebble
#

My BAR calculation or finding is not correct it seems

still pebble
#

4 hours

still pebble
#

Got admin commands working on real hardware so far

worthy jasper
#

testing on real hardware is based

still pebble
#

Yeah, I will never be satisfied if my OS only works in emulator

#

Once my NVMe driver works on real hardware, I will be very, very well set for a ton of features

worthy jasper
still pebble
lean dagger
#

I just found this thread and it's really cool that you got this far by yourself! Also are you planning to add something so that you can make apps for your os?

still pebble
lean dagger
#

nice

still pebble
#

The OpenGL implementation I made even has its own shader compiler which I am proud of lol

lean dagger
#

wow

still pebble
#

My nvme driver now works on real hardware!

#

Ez4saalty

#

The NVMe driver on real hardware

soft solar
still pebble
#

Thanks!

livid summit
#

since when was ls recursive

still pebble
#

What do you mean?

still pebble
#

now that I am back, I just now realized you meant the "touch bruh?hello". It would not create a file inside bruh, there was just a bug that made slashes always be question marks

#

better example

still pebble
#

It feels so nice how my computer flashes lights on every one of my disk reads, it recognizes it fully ๐Ÿ˜„

#

Now it automatically adds home, bin, and etc directories

worthy jasper
#

good stuff ๐Ÿ˜Ž ๐Ÿ‘

still pebble
#

Yup, next step: I made an interpreter for my programming language that should be extremely easy to port

#

I will make my first programs in my OS!

worthy jasper
#

that's so based

still pebble
#

Thanks, it also comes with a compiler that luckily compiles to 64bit nasm assembly, so maybe I could port an assembler later

livid summit
#

like ls

#

etc

still pebble
soft solar
#

I'm so jealous lolz, that's some great progress

still pebble
#

thanks!

#

I finished porting my language by the way

#

just doing some finishing touches

#

And whats even better: I HAVE SPINNING DONUT CODE FOR IT!

#

With lighting and all that stuff

worthy jasper
#

TORUS GANG

still pebble
#

Man, this port is taking way longer than expected, sorry guys

still pebble
#

Got the interpreter running code, but has a few bugs to fix before I show you guys

still pebble
#

Successfully ported!

#

the output is the numbers after "Running BF file..."

worthy jasper
#

oh that's neat!

still pebble
#

Spinning donut coming soon!

#

Also, thanks so much guys for the support of this OS

#

5.6k loc so far

bitter echo
#

Do you have a github with your current progress in it?

still pebble
bitter echo
#

Ty

still pebble
#

๐Ÿ‘

unborn forge
#

i'll let you find the bug

#

:p

still pebble
#

Oh shit

#

you mean I should set the sp before ss?

unborn forge
#

no

#

it's a bit more subtle

still pebble
#

well im lost

#

๐Ÿ˜…

#

havent touched the bootloader in a while

#

oh bruh

#

this

global bootentry
bootentry: jmp entry0

db "UNTITLED_OS"

entry0:
    jmp 0:entry

needs to be

global bootentry
bootentry: jmp 0:entry0

db "UNTITLED_OS"

entry0:
    jmp entry
still pebble
unborn forge
#

because a mov to ss disables interrupts for the next instruction

#

either that, or wrap it in cli/sti

#

but that wastes more valuable bytes

still pebble
#

ill patch it up rq

still pebble
#

Spinning donut working!

#

It's poorly formatted but whatever

still pebble
#

Can't believe this is my own programming language, OS, kernel, and bootloader. I feel proud of myself

#

also updated the github

#

Next I have to port dwm and make some terminal emulator

livid summit
#

this looks like C

worthy jasper
still pebble
still pebble
livid summit
#

you said its your own language

still pebble
#

(porting the C++ was a pain)

#

Main thing to take away is the difference in casting:

byte:someByte = 120;
int:final = cast(int:someByte);
still pebble
livid summit
worthy jasper
#

i don't think saalty meant to imply that the OS was written in their language, just that they had written an interpreter for their own language

#

(to be fair, i haven't had a look at the repo)

still pebble
willow path
still pebble
#

Nice

willow path
still pebble
#

Oh I mean I did my spinning donut in my own programming language in the video

willow path
#

is it running in userspace btw?

still pebble
#

Yeah 64bit userspace

willow path
#

nice

#

i think mine wasn't back then

#

i don't remember lol, haven't worked on my kernel in a while

#

well i have written a few lines here and there but i've had other projects

still pebble
#

Yeah, it's the same with me, I've only recently been putting in work on it

willow path
#

i don't think i've posted about it here on osdev yet, might do later on when there is some actual software for it

still pebble
#

Nice

willow path
#

currently the only software is a test suite lmao

#

i wrote an emulator in C++ and i also have a implementation in verilog

#

verilog one is rather simple, it isn't even pipelined

still pebble
#

What is Verilog?

willow path
#

a hardware description language, you design hardware with it

still pebble
#

Oh alright.

willow path
#

althrough verilog does have C-like syntax

#

i'm actually surprised i managed to even pull this off within a month. I never did anything in verilog before

still pebble
#

Yeah, I've heard of people using it for various hardware projects, I wish I knew about Verilog before designing my breadboard CPU

willow path
#

i mean for a breadboard CPU it wouldn't be that useful i think?

#

i don't think you can get any easy to build logic out of it

#

well unless you work with it at the logic gate level

willow path
still pebble
#

It was at logic gate level, just used some ICs for memory and that's it

willow path
#

i mean

#

i guess verilog could have been useful

#

still easier than putting logic gates together in some software and on top of that you can run your CPU on any FPGA

still pebble
#

I wouldn't want to use FPGAs as I was, and still am, designing the PCB for it

#

I don't intend it to be practical, more of a learning experience

willow path
#

it's gonna have to be complicated otherwise there will always just be one with better performance and lower power consumption

#

and if you make a simple one like this it's gonna be incredibly far from anything useful for anything other than having fun

#

mine is also just for fun

still pebble
#

Welp I don't have to worry about that, I program to attract girls, not practicality

#

๐Ÿ˜Ž

willow path
#

lmao

still pebble
#

Progress update so far is I implemented arrays in the interpreter I ported, and working now on debugging APIC and making the NVMe driver interrupt based

still pebble
#

How hard would it be to port xorg?

unborn forge
#

it's hard but not that hard all things considered

#

the hardest part is probably sockets

still pebble
#

Hmm, yeah I would need some sort of networking for it

unborn forge
#

i wouldn't call UNIX sockets networking strictly

still pebble
#

Oh you mean that type of sockets

#

Yeah, I think it'll be alright to implement

#

First got to get my NVMe driver and language to a stable point though

livid summit
#

i think you want a good working system before you even think about porting something like xorg

#

you dont have a proper shell yet afaict

still pebble
#

Yeah my system is still premature and the shell was lazily done, but it should be easy to polish things up and get everything stable, the main problem is the NVMe driver right now I would say

livid summit
#

well do you plan on porting bash or creating your own shell

still pebble
#

My own shell

livid summit
#

that will take some time then

#

assuming it isnt literally just looking up a program name then running it

still pebble
#

Yeah, I don't want my shell to be nearly as complex as bash right now, maybe later I will port bash

livid summit
#

why not as complex as bash?

#

or maybe not quite as much but typing the name of a program is hardly a shell

#

you need things like pipes etc

still pebble
#

I will add parameter handling and stuff, I am not too sure yet ๐Ÿ˜…

still pebble
#

NVMe driver works fully interrupt based now with MSI-X and APIC, previously I was waiting a constant time by reading from port 0x80

#

I feel really, really good now that I got that out the way

#

I knew that was insanity ๐Ÿ˜…

still pebble
still pebble
#

AML is batshit crazy

still pebble
#

Alright, I detected the IOAPIC on real hardware

still pebble
#

taking a 1 day break from the OS

#

will debug the IOAPIC tomorrow

still pebble
#

I will take another day break as I am going to be dropping out of high school, and I have to get things sorted out.

sharp glade
#

you've probably made up your mind but everyone I know who dropped out of high school regretted it immensely

#

In almost every case it either stunts you for a few years (which is if you get a GED or get lucky) or dooms you to mediocrity for life

#

If there's any way you can graduate even a little late you should do that instead even if it swallows up a whole summer or something

soft solar
#

^

#

listen to hyenasky

sharp glade
#

I almost dropped out at one point and I'm extremely glad that I didn't

livid summit
#

my dad keeps telling me to drop out

sharp glade
#

I graduated by the skin of my teeth and then found out your HS gpa doesn't even matter because you should probably do your gen eds and lower division major courses at a community college anyway (because it's absurdly cheaper, and they accept anybody, IF you have a high school diploma or equivalent!) and that's all they'll look at when you transfer

sharp glade
livid summit
#

scotland

sharp glade
#

Your dad is silly

livid summit
#

he seems to think since i got an internship that i no longer require education

still pebble
#

Yeah, I am aware that it can screw a lot of things up, but sadly I don't have options school-wise, as it has been getting harder and harder to do school at all due to severe OCD and ADHD, and I have reached my breaking point. I don't want to go fully into the details, but all I can say is I wish things wouldn't have turned out this way. Today my dad was actually quite excited, because he was going to buy me a new processor because I was going to do my schoolwork after a year and a half. Few hours later I mentally broke down because of that, so I told him to just not buy it. It's quite sad

sharp glade
#

Well like I said if you live in the US you'll get a second chance at community college no matter how bad you did in HS but only if you get your diploma

#

College is easier than HS at least in my experience

still pebble
#

I live in Canada

sharp glade
#

It's probably similar

soft solar
still pebble
#

hey guys, I will most probably not drop out first of all, second of all I will now be accepting any contributions with open hands while I take a few days to work on a side project

#

github is here, I will accept PRs that are beneficial to the project ๐Ÿ˜„

#

after the break I will continue debugging my interrupt handling

#

(note, running it wont show much)

still pebble
#

What resources does the innovative GPU man use for developing lil igpu library

#

I have decided that breaks are for losers, and will start making an iGPU driver

shut pewter
# still pebble I have decided that breaks are for losers, and will start making an iGPU driver

I highly recommend integrating lil to save you the torture, if youโ€™re sure you want to do it yourself, itโ€™s a tiny bit of intel docs, sprinkled with some Linux code, based on a metric truckload of reverse engineering GOP drivers, fucking around with passthrough for testing, comparing register dumps against Linux, and a bunch of heavy lifting from potentially already existing drm code in managarm and Mesa llvmpipe for the software rendering (eventually mesa hardware acceleration but weโ€™re not there yet)

still pebble
#

alright, I will save myself and port lil instead which I hope will be easier

#

I will have to port it because there is no haswell option last time I checked

shut pewter
#

Not yet

#

Itโ€™s on the todo list

still pebble
#

alright, I think its most wise for me to just wait

#

Holy shit, I was using flags or'ed together which were secretly

#define MALLOC_AVAILABLE_BIT 52
#define MALLOC_NO_EXECUTE_BIT 63
#

This is for page allocation

#

This might be why APIC is failing

#

It might not actually disable cache

#

Nope

still pebble
#

BRUH

#

Now it works

#

The redirection table entries, I thought the first entry was for ISA IRQ 0

#

Turns out its second

#

god I hope this works on real hw

still pebble
#

ACPI is utter dogshit, for this next step I need to parse AML. I am not going to

#

Oh wait, AML is not needed

#

PHEW

#

At least my OS boots now

#

Finally keyboard works now too

#

Alright, this shit is done, next step is debugging my language interpreter

#

shit is not done, NVMe driver hangs in userspace

#

gotta love osdev

#

this is confusing, NVMe driver handles multiple I/O commands just fine at kernel space

#

On a side note, the OS is now 7k loc, including kernel and bootloader

#

Close to being my first ever 10k loc project

sharp glade
#

lmk when u get to 100k club...

#

100k....................

#

6 figya.....

still pebble
#

That would take too long for some kid who develops at 500 loc per week

#

I focus on increasing the functional density of code rather than lines

still pebble
#

Going to spend more time now on polishing and modernizing aspects of the OS

still pebble
#

sometimes I feel like this stuff doesnt even interest me and that I am just a masochist

worthy jasper
#

any updates?

still pebble
#

My motivation is a sine wave

soft solar
snow cloud
#

if presumably 1 means you're motivated, and 0 means you're not motivated, then what would -1 mean?

#

you motivate others?

soft solar
still pebble
#

I just had -1 motivation again, now should be all motivated though

#

The problem right now is I am using my NVMe driver in my syscall handler, and I cannot wait for the NVMe interrupt in another interrupt

loud bear
still pebble
#

And what do you even mean by process? It is done in the kernel

loud bear
#

you were talking abou syscalls, so I assumed youz have a scheduler sorry

#

Im just trolling

still pebble
#

I need to wait for the NVMe interrupt inside my syscall handler

loud bear
#

fuck

still pebble
loud bear
#

I accidentally did ctrl+enter instead of shift+enter

#

anyways

loud bear
still pebble
loud bear
#

what am I missing?

#

highlight the word

still pebble
#

"process" there is nothing process related in what I am doing

#

I also call my NVMe driver before any scheduler even starts (and it works in this case), but when I call it in my syscall handler called by processes, it is nested interrupts

loud bear
#

my point is to exit the handler and do smth else in the meantime

still pebble
#

thats basically impossible, as filesystem tasks are not done by a process, its done by the kernel syscall handler

loud bear
#

then look at the Windows source code or smt

#

h

#

(Im trolling again)

still pebble
#

I am so bored

soft solar
#

how about creating a separate thread for the nvme driver?

#

nah that probably wouldn't work

still pebble
#

yeah I dont think theres a good way to do that

loud bear
#

then maybe do AHCI or ATA instead

#

who needs NVME in 1923 anyways?

#

see what I did?

#

warped back 100 years

soft solar
still pebble
#

I dont have words for how stupid what you just said is, I am not giving up on NVMe. If any other OS can do it, I can too

#

I will find a way

loud bear
#

how does NVME work on architectures with no interrupt support?

#

like interrupts has to be an Intel thing right?

bitter echo
#

... What?

soft solar
#

what

still pebble
bitter echo
#

btw its useful to have some kind of 'wait for event' function, for things like this. So you can wait on the nvme driver to do its thing.
Also you dont need to have interrupts disabled inside your system call handler the whole time, really just any critical stuff you do at the entry - then it can continue on like any other thread. Meaning you can receive other interrupts, like from devices.

#

welcome back btw

still pebble
bitter echo
#

yeah that'd work, you'd benefit from making it more generic though

#

a system call is just an entry to the kernel doing something for a thread

daring citrus
#

you should be able to switch from the syscall handler, it should be still executing in the context of a process, itโ€™s just that the stack, cs, as and rip arenโ€™t user ones

still pebble
#

Yeah, I'd really have to redesign things for that though. I will redesign it later though, I just want to do it quick and dirty for now

bitter echo
#

why nooo ?

still pebble
daring citrus
still pebble
#

That is the solution

bitter echo
bitter echo
#

gotta be quick around here ๐Ÿ˜›

daring citrus
#

basically when you enter the syscall you donโ€™t do anything special

#

you just do kernel stuff instead i guess

#

ugh i am terrible at explaining

bitter echo
#

even if the hardware does special things like disabling interrupts, you want to return to some kind of normal state - so you can be pre-empted like normal, etc

daring citrus
#

and iโ€™m not sure what you currently do for syscalls

still pebble
#

my syscall is done the old fashioned way, through int 0x80

bitter echo
#

so ideally it would look like:

  • user code performs a syscall
  • kernel code starts running with whatever the cpu setup for you
  • some critical syscall setup happens
  • kernel drops back to normal operating state and continues on with syscall
    [ ... normal operation happens ... ]
  • at some point later the syscall does what it's thing, and returns to the user code.
#

how you actually trigger a syscall is an implementation detail

#

and ideally the critical section at the start (time with interrupts disabled) is very small

still pebble
#

hmm, I think what I will end up doing is the syscall will do everything purely inside it only if it doesnt require interrupts itself. If it does need interrupts, like in this case, then an OS worker process will be added that will do the things it needs to (the process that called this syscall would be suspended during this time)

#

so the syscall handler itself will exit right after the worker process is added

bitter echo
#

one of the other reasons for wanting to keep interrupts enabled (at least imho) is for timekeeping

#

I mean that as a general comment, not a critique of your idea ๐Ÿ™‚

still pebble
#

yeah, because timers need interrupts to function most of the time

#

Thanks for all the help man, I will try to get my idea working soon

bitter echo
#

all good, and good luck

still pebble
#

thanks

still pebble
#

if thats what you meant

livid summit
#

why not just do it in a thread context

still pebble
#

Why would I do it in a thread context

still pebble
#

I will be accepting suggestions for the name of this OS

#

I will give some of my ideas, and will give upvote/downvote reactions to them so you can vote

#

Sadly I dont have any ideas

still pebble
#

I have decided that syscalls will now be processed in their own thread and not inside an interrupt context, to avoid interference with other processes and its safer than nested interrupts

#

This should be quick to implement

#

I also think that this is what Windows does

livid summit
#

something like exit basically consists of moving the process out of the queue and then letting waiting threads know it has exited

still pebble
#

right, I will only put the handler in a thread if it requires interrupts

#

like for nvme

livid summit
#

yes that makes more sense

still pebble
#

yup

daring citrus
#

why do that

#

when u can just enable interrupts and let the syscall block

#

:p

worthy jasper
worthy jasper
soft solar
#

ILS - i love salt

still pebble
worthy jasper
#

L.O.S.S. Operating System Schematics

hmgmd not happy with this one, but loss lmfao

still pebble
#

I think I will just do SOS

#

SOS sounds cool

worthy jasper
#

L.O.S.S. Operating System, Saalty('s)

lmfao

daring citrus
# still pebble wdym?

why overcomplicate by spawning new threads, blocking on other threads when you can just do all the work in the syscall handler? if you need to wait for a device (like an nvme drive, though that should be abstracted away obviously) you can simply wait, maybe reschedule, if you don't have an event system you can busy loop (bad) and let the process get preempted, and when an nvme interrupt arrives and the interrupt handler does its job you can break out of the busy loop (BAD BAD BAD) in the syscall handler and proceed

#

though you really shouldn't have to loop and wait for that stuff in the syscall handler... as i said it should be neatly abstracted away behind some device interface, done through the vfs

#

so all you should do in the syscall handler is call vfs_read or whatever you're trying to do, and that might block - but that's okay, it will wait for an event that will be raised by the nvme completion handler or whatever, and the thread will be unblocked, vfs_read will return back to the syscall handler and return back to userspace

still pebble
#

I dont have a VFS, and I think I will just busy loop as this event system stuff doesnt really interest me. I dont see whats so wrong with a busy loop

daring citrus
#

because that way you don't give up the cpu time to other threads, instead you just waste it waiting for something

#

of course instead of busy looping you can just yield

#

idk why i didnt say that in the example

still pebble
#

i have round robin single-processor scheduler, it shouldnt matter

daring citrus
#

ok let me put it that way, every thread gets its own time slice, and if one thread spends its time slice doing nothing, that's bad

#

of course you can't control what user programs do exactly, but you should avoid doing that in the kernel

#

that gives other threads more time to run while you wait for an interrupt to occur

still pebble
#

ah whatever, I dont care too much about the performance of this OS, just functionality

daring citrus
#

if a few threads try to read/write to the disk at once it will also become unusable... so

#

its nothing crazy, you literally reschedule to another process instead of waiting pointlessly...

#

its not even an optimization it's something you should do ๐Ÿ˜„

still pebble
#

I will not have multiple disk IO at the same time, it will be purely synchronous

#

if another process wants to do IO while another process is doing IO, it will be forced to wait through mutex because anything more advanced I am not getting paid enough for lol

still pebble
#

IT WORKS YOU FUCKERS, IT WORKS!

#

๐Ÿ˜‚

#

Finally!

#

Now syscalls get cleanly handled in their own thread and I can finally do disk I/O again

#

Now I have to get back to debugging the OS's script interpreter

still pebble
#

We should celebrate this somehow, it took me months to get this working

soft solar
#

wine

still pebble
#

I cant lol

#

but the OS is 69 source code files now as well

#

and a total of 7k loc

still pebble
#

If I put my OpenGL implementation in the OS, it will turn into a mean 10k loc

worthy jasper
#

LETS GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

#

WOOOOOOOOOOOOOOOO

#

๐ŸŽ‰ ๐Ÿฅณ ๐ŸŽ‰

still pebble
#

Now thinking of whether its worth it to implement SMP... I have it implemented in my old OS, but adapting it to my current OS would be a pain...

#

I am just REALLY glad I got interrupts for NVMe fully working

still pebble
#

The rust crab irritates the shit out of me, just saying

bitter echo
#

if you're going to do SMP, do it from the start

#

adding it later on can be painful

hollow lintel
#

when implementing SMP you will have to rewrite lots of code just because either it was thread unsafe, either it wouldn't apply to a smp system

#

designing the os from ground up with smp in mind will result in more reliable and solid code

#

trust me, I've gone through a no-smp to a smp transition and was a pain to do so

still pebble
#

yeah, I guess its staying single core, I am way past the point of the code being flexible enough to allow SMP

hollow lintel
#

I did that transition when I had a full userspace with drivers working

still pebble
#

its just too much of a pain

still pebble
#

I will get this OS on real hardware again, only thing I need to fix is the APIC/IOAPIC initialization

#

Everything works on real hardware other than APIC/IOAPIC initialization

still pebble
#

I am going to reverse engineer my motherboard's firmware's GOP implementation to hopefully get started on iGPU driver for this OS

livid summit
#

seems a bit strange to me to do that now but ๐Ÿ‘

hollow lintel
#

firmware**

still pebble
#

I am getting logical and reasonable assembly code when disassembling it

hollow lintel
#

then I wish you good luck!

still pebble
#

thanks!

#

I will get to it in 1 hour

#

if I dont then someone please remind me with ping

still pebble
#

AAA instruction perfectly describes how I am feeling right now

#

AAAAAAAAAAAAAAAAAAAA

still pebble
#

im going to take break from re and write a POSIX compat layer

still pebble
#

will take 1 week break from this OS to write an x86_64 PC emulator

still pebble
#

I think I am burnt out heavily, so I will take a huge break until I feel motivated enough again to work on this OS. Actually in december, I will gain a development team member (who is my friend), so will probably come back in december

#

Really sorry for all these interruptions in development, I fully intend to keep developing this OS, I just need to get out of burnout

worthy jasper
#

that's okay bud, i'm here for you (probably won't be able to help much cuz i'm very inexperienced), at least as moral support. enjoy your break :)

still pebble
#

Thanks! I will try to enjoy it lol

loud bear
#

well

#

no need to repeat what mangomeep said

still pebble
#

also nice nickname

loud bear
#

now its even better

#

btw ur a walking salt shaker that ovenengineers everything

still pebble
#

yeah

still pebble
#

I feel motivated!

#

I am going to make a GLSL compiler for this OS

worthy jasper
#

:0!

still pebble
#

Making good progress, and this is actually enjoyable to develop

#
#ifndef FREESL_H
#define FREESL_H

#ifdef FREESL_FREESTANDING

#ifdef FREESL_MALLOC_IMPL
#define malloc(_Size) FREESL_MALLOC_IMPL(_Size)
#else
#error "freesl: Please provide a `malloc` implementation defined as FREESL_MALLOC_IMPL"
#endif

#ifdef FREESL_FREE_IMPL
#define free(_Block) FREESL_FREE_IMPL(_Block)
#else
#error "freesl: Please provide a `free` implementation defined as FREESL_FREE_IMPL"
#endif


#else

#include <stdlib.h>

#endif // FREESL_FREESTANDING

#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>

typedef enum 
{
    FSL_TOK_ASSIGN,
    FSL_TOK_ADD,
    FSL_TOK_SUB,
    FSL_TOK_MUL,
    FSL_TOK_DIV,
    FSL_TOK_VAR,
    FSL_TOK_CONST,
    FSL_TOK_SWIZZLE,
    FSL_TOK_CAST,
    FSL_TOK_CALL,
    FSL_TOK_MEMBER_ACCESS
} FreeSL_TokenType;

typedef enum 
{
    FSL_TYPE_INT,
    FSL_TYPE_FLOAT,
    FSL_TYPE_VEC2,
    FSL_TYPE_VEC3,
    FSL_TYPE_VEC4,
    FSL_TYPE_MAT2,
    FSL_TYPE_MAT3,
    FSL_TYPE_MAT4,
    FSL_TYPE_INT,
    FSL_TYPE_CUSTOM
} FreeSL_TypeOrigin;

typedef struct _FreeSL_Type
{
    FreeSL_TypeOrigin origin;
    size_t size;

    // Only if origin is custom
    struct _FreeSL_Type* members;
    size_t member_count;
} FreeSL_Type;

typedef struct
{
    char* data;
    size_t size;
} FreeSL_String;

typedef struct
{
    FreeSL_String name;
    FreeSL_Type type;
    void* data;
    bool is_array;

    // Only if is array
    size_t count;
} FreeSL_Var;

typedef struct
{
    FreeSL_TypeOrigin type; // Not FreeSL_Type because constants can only be builtin types
    void* data;
} FreeSL_Const;

typedef struct
{
    FreeSL_TokenType type;
    
    // Only if is var
    FreeSL_Var* var;

    // Only if is const
    FreeSL_Const constant;
} FreeSL_Token;

#endif // FREESL_H
#

what I have so far

#

It will support structs too

#

version 330 will hopefully be mostly supported

#

At first, it will just directly execute the AST tree for simplicity, but then I will make it compile into my own bytecode

still pebble
#

its going good so far

still pebble
#

about 50% done the core C interpreter for it that I will build off of

#

working blazing fast after burnout lol

#

proof of progress

still pebble
#

so I can generate AST for C code now

#

maybe could make two branches of it, one for GLSL and the other one for plain C

#

people be porting some C compiler while I make a custom one ๐Ÿ˜Ž

#

I will share progress soon

still pebble
#

Boom!

worthy jasper
still pebble
#

GLSL parser is done! Very very close to having modern OpenGL support in my OS!

still pebble
worthy jasper
still pebble
worthy jasper
#

fuck yeah B)

loud bear
still pebble
#

I dont plan to fucking run cyberpunk lmao

#

Maybe like 10-poly quick demos

waxen zenith
#

u really wrote ur own compiler damn

#

are the lexers and parsers done?

unborn forge
still pebble
#

best thing about it, is its for an existing language (glsl) so I can run existing shaders

waxen zenith
#

have you made any other programming languages?

still pebble
#

yes I made 5 others

#

in increasing complexity

#

this is by far my most complex parser I have ever made

waxen zenith
still pebble
misty token
#

Ofc it won't be able to run the latest games in real time, but often that's not the only reason one would do that.

shut pewter
still pebble
soft solar
soft solar
#

699th message

soft solar
#

Don't be assholes

#

Look at his BIO, he is very depressed right now

#

My point? It is that you should be like lukflug

still pebble
#

Depression is not an excuse to be rude as well

#

plus I dont think calling someone ignorant is very rude, just informs them to look more deeply into what they are saying I guess

#

Enough of this though, back to my compiler

bitter echo
#

What's the current progress of your opengl implementation?

still pebble
#

no actual openGL functions implemented yet, just decided to start with hardest thing first

#

also just implemented function overloading

misty token
hollow lintel
#

the fact that opengl is usually implemented in hardware doesn't make it hardware-only

still pebble
#

thats the beauty of it

hollow lintel
#

yeah

#

plus it can be efficient in software if avx or any kinf of simd is used

#

basically opengl works with lots of number and matrix operations and those can be accelerated using said simd

#

I don't find software opengl that bad

#

I really want to see your implementation run half life 1

exotic lintel
#

I wouldn't have treated the "are you on crack?" as an insult

soft solar
misty token
daring citrus
#

:)

#

what about arm cpus? they surely must be hardware only right?

#

enough mocking around, anything can be implemented in software

soft solar
misty token
soft solar
#

touching grass is only hardware sadly

still pebble
#

Finally I am back

#

I got the OS working fully on real hardware again just recently, this time with the NVMe driver being interrupt based

#

Also happy new year guys!

bitter echo
#

Welcome back

#

Happy new year ๐ŸŽ‰

misty token
worthy jasper
#

merry new year & welcome back saalty!

worthy jasper
#

i had a look at the github and it doesn't seem like it's been updated in a while, but i'm interesting in having a look at the latest version. i'd like to see if i could get it running on my hardware lol

still pebble
#

Thanks guys!

still pebble
#

It will use the first NVMe drive it finds as the filesystem, so make sure you have at least 1 NVMe drive in your computer and make sure you are not using any of them for anything else

proud pecan
still pebble
proud pecan
#

That sounds like a future issue but you do you

still pebble
#

probably not going to be an issue as I am not using my NVMe drive for anything else

still pebble
#

also the kernel now uses APIC and IOAPIC for interrupts rather than the old PIC

worthy jasper
#

i'll check it out with qemu tho :3

worthy jasper
#

well i cloned the repo and ran make

/usr/bin/ld: /tmp/ccnTGF6I.o: in function `InitTable':
vmalloc32.c:(.text+0x3ba): undefined reference to `__stack_chk_fail'
still pebble
#

(on your laptop)

still pebble
unborn forge
#

-fno-stack-protector -fno-stack-check

#

those flags exist in the c-template for a reason...

#

alternatively, you'll have to implement the stack protector runtime, which evidently it's not in this case

proud pecan
#

The stack protector runtime is only like a function and a variable

#

Pretty useful sometimes

still pebble
still pebble
#

every OS needs some entertainment, so I am adding a gambling system

#

it will be a CS-like case opener

worthy jasper
#

well

it draws a white line at the top of the screen, then it quits qemu

still pebble
granite remnant
#

if you have bad luck it deletes itself

soft solar
still pebble
still pebble
#

Its gambling time

#

Next I will make an art program for it

proud pecan
#

Nice!

worthy jasper
still pebble
#

but 128 MiB is recommended

worthy jasper
#

oh okay lol

worthy jasper
#

i don't know much about qemu but i believe there's some debugging built into it? again, i don't know much, but if somebody taught me i'd be happy to provide whatever info is needed

bitter echo
#

so have you decided on a name for this os yet? ๐Ÿ˜›

worthy jasper
#

well it's either TheOS or SOS, afaik

still pebble
still pebble
#

god I am indecisive

bitter echo
#

uhhhhhhhh

still pebble
#

Wait thats perfect

#

Alright, uhhhhhhhh is the name of the OS

#

Its official

#

saalty's named OS (uhhhhhhhhOS)

worthy jasper
#

u8h

still pebble
#

u8h doesnt seem as funi

misty token
#

yay! finally got a name

still pebble
#

yup!

still pebble
#

More urgent

#

xHCI docs downloaded, time to grab some popcorn.

soft solar
still pebble
#

๐Ÿ˜ข

still pebble
#

xHCI driver going good, getting nice progress.

#

Some of it is a lot like NVMe

#

Which is good

still pebble
#

XHCI driver is going amazing so far, 90% of the way to having the xHCI controller fully initialized!

bitter echo
#

Wow cool

still pebble
#
typedef struct
{
    uint32_t RunStop : 1;
    uint32_t HCReset : 1;
    uint32_t IntEnable : 1;
    uint32_t HSErrorEnable : 1;
    uint32_t Reserved0 : 3;
    uint32_t LHCReset : 1;
    uint32_t CSS : 1;
    uint32_t CRS : 1;
    uint32_t EWE : 1;
    uint32_t EU3Stop : 1;
    uint32_t Reserved1 : 1;
    uint32_t CMEnable : 1;
    uint32_t ETEnable : 1;
    uint32_t TSCEnable : 1;
    uint32_t VTIOEnable : 1;
    uint32_t Reserved2 : 15;
} USBCMD;

Thank god for this syntax man, this has saved me so much time, I love it, I really love it

#

I think they are called bit fields

worthy jasper
#

what is that syntax? / what does it do? i've never seen it before

still pebble
bitter echo
#

do note that bitfields can have weird behaviour

soft solar
bitter echo
#

You'll still be loading and storing bytes/dwords/etc as thats how cpus work. If you're dealing with mmio this could lead to side effects.

granite remnant
still pebble
#

Wanted to take a moment to thank everyone here who has supported me so far, I am truly grateful. OS development is changing my life in good ways, its just a field like no other I have ever done, and I credit my progress to you guys who have been sticking with me in this journey. Thank you a thousand times โค๏ธ

still pebble
#

hey guys, theres not any progress update yet because I am being hit by a wave of procrastination, will try to work more on this now though

#

sorry about this ๐Ÿ˜ข

worthy jasper
still pebble
still pebble
#

I love C, C is great
Loving C is my fate
I love that char size is always eight
I would go to a different state
Just so that me and C could go on a date

As you can tell, I am tired
I am restless, my mood has expired
I dont know why I am rhyming
At least its for something that is loving

still pebble
#

i need an emotional support buddy

soft solar
worthy jasper
still pebble
#

My friend is also now working on this OS, and the XHCI driver is now in the debugging stage

still pebble
#

This is the project link by the way

#

XHCI driver is here

#

or, at least the progress on it ๐Ÿ˜„

worthy jasper
#

it was never joever,

we're joe back

still pebble
worthy jasper
#

i'm sorry i'm suffer from extreme mental degradation due to being online

a small translation: welcome back :)

still pebble
nocturne shale
#

we got xhci reset working! we didn't do aligned reads, and the only way we found out that was the issue is by reading source code from qemu

still pebble
#

^ ske is the one contributing as well

#

we did a lot of progress today

#

The next thing we will likely work on is getting HPET working for a precise sleep function for drivers

#

(because we need sleep function for xhci)

nocturne shale
#

the ultimate goal is to implement the mouse

still pebble
#

yeah

#

we could stick to ps/2 keyboard, but its probably best to do usb keyboard too

nocturne shale
#

the question is

#

what is the embedded keyboard on real hardware

#

is it also usb?

still pebble
#

i have never heard of an embedded keyboard before

slim edge
#

laptop keyboards?

nocturne shale
#

i mean like, laptop keybard

slim edge
#

most are ps/2

still pebble
#

ok then we can probably use ps/2 as a fallback if there is no usb keyboard

stray latch
#

does the bootloader use UEFI or BIOS loading since on all intel processors from 2020 and above do not support BIOS anymore.

unborn forge
#

that is incorrect btw

#

intel processors after 2020 can totally support BIOS with an external GPU that supports the legacy video modes needed

still pebble
nocturne shale
#

EFI will probably come.. at some point

#

while it is more fun to develop the BIOS version we'll do that

#

i think at least that part of osdev is having that enjoyment of doing it yourself

unborn forge
#

sure whatever you say

nocturne shale
#

i mean of course if you done it many times it's not that interesting, probably will be same for me eventually

#

it's a hobby because it's interesting

unborn forge
#

bootloader dev isn't really osdev and it easily detracts from the actual osdev experience if you get distracted

#

it's also not a super trivial thing to get right, especially if running on real hardware is a concern

still pebble
#

Hello everyone, its been long since we last posted but right now I am finally working on this OS again, so right now I am making a driver structure system

#

I am making a generalized storage driver structure right now, so that we can abstract away the type of storage devices and just have, y'know, storage devices

#

There will be commands to find what driver a storage device is using, for example

| storage0 - nvme
| storage1 - usb
| storage2 - usb
| storage3 - sata
#

On the XHCI side of things, we'll probably have to stop using bitfields which will take some time to rewrite all the structure members

bitter echo
#

Cool to see you're still going

still pebble
#

yeah, this must be my only long-term project lol

still pebble
worthy jasper
#

well what are they now?

still pebble
#
## Goals for my OS:
# 1. USB
Currently implementing xHCI.
# 2. Games
I am planning on porting some 3d games to it, with my half-assed OpenGL 3.3 implementation. And will add my GLSL parser/soon-to-be-interpreter to it too
# 3. Compatibility
Not sure about being compatible with existing applications, will probably just make my own format
# 4. Window manager
I will replicate how Android looks, but will add features from PC operating systems, like Windows
# 5. File system
My own custom file system will be implemented (done)
# 6. Driver management
Create a way to generalize/abstract drivers to make the OS cleaner and more modern
#

@worthy jasper

still pebble
#

Oh, and I will make drivers get their IRQ dynamically allocated!

#

After this will also have to finally make a kernel panic function...

still pebble
#

Pushed my latest progress

#

Coming together very nicely

still pebble
#

Added panic

#

Finally

worthy jasper
still pebble
still pebble
#

Huge things are coming to this OS!

still pebble
#

Major update!!!!
The changelog:

- Added a driver manager which can abstract storage devices from their drivers and automatically get their format detected with any of the available Filesystem drivers
    - The driver manager accepts StorageDrivers and FilesystemDrivers for now, but once XHCI/USB is finished there will be mouse and keyboard drivers
- Deprecated the IDE/ATA driver
- The codebase got a big cleanup!
    - Notably, idt.c is much much cleaner now and doesnt contain the kernel's drawing functions anymore
    - The kernel's drawing functions got moved to draw.c/draw.h in the same directory
- The drivers now no longer have their designated IRQ line hardcoded; the driver manager passes the next available IRQ line to a driver if the driver requests IRQ support, which the driver can then hook up to its own IRQ handler
- Added a panic function with its own string formatter, also displays the file which caused the panic

https://github.com/waternine9/untitled-os/commit/3ac5510bf9ee7956b90d07a0e04669bd9c76dc5a

#

@nocturne shale helped a lot too, notably the string formatter (which I suck at making lol)

#

Next thing to do right now is rewrite the XHCI driver to not use bitfields, and make commands to list devices and their respective drivers and more file ops

still pebble
#

The OS is moved to codeberg because I lost my github account due to its mandatory 2FA

worthy jasper
#

o7

still pebble
#

saalty's unnamed OS

#

Decided to also scrap that name and keep this OS unnamed, until I get a great name idea which might be never lmao

worthy jasper
#

definitely fair tbh

still pebble
#

yeah i think there is beauty in anonymity, so its probably going to stay this way

kind oyster
#

Yeah I think so too! beauty in anonymity

exotic lintel
#

why not just... get 2FA?

#

contrary to popular belief you don't need a phone number for 2FA; you can use an authenticator app/device

#

I don't exactly care that you aren't using github anymore but that is a stupid reason to give it up

still pebble
#

I just want to be able to login painlessly

atomic juniper
#

that's why you keep the backup codes somewhere

worthy jasper
#

eh github stinki and owned by microsoft

still pebble
still pebble
#

Been procrastinating recently, like a lot, but this project is far from abandoned for anyone interested in its development.

#

I still have plans for major features (like OpenGL 3.3 support), and while I cannot predict how long it will take, I can say its coming.

#

But, first thing to finish right now is USB/xHCI support, which will provide much better support for HID than the PS/2 emulation from the firmware that the OS is reliant on right now.

#

For example, PS/2 mouse doesnt work on my hardware, which could be because my PS/2 driver is flawed, or because the firmware is flawed. I dont want to spend a lot of time debugging just to find out its the firmware's issue.

#

Figure 1, graph of my motivation. (x axis being time, y axis being motivation)

versed pendant
atomic juniper
#

halfmemeright Same here, but this would be more accurate

still pebble
#

oh man, april fools even reaching this server's "serious" announcements

#

Limine will now be a GRUB fork, in order to benefit from a lightweight I knew it was a joke after reading "lightweight"

#

but, april fools aside, me and ske will be developing a windows compatibility layer for this OS. (meaning xhci will have to wait for now)

#

The goal is to support windows 10 notepad

pastel onyx
#

Umm

#

Have you ever seen || ?

#

all these if statements make me want to delete myself

still pebble
still pebble
#

drawman.c is probably what you are talking about
I was quite indeed aware of logical or, but I personally think seperating each of those conditions looks more readable

pastel onyx
#

All files

still pebble
#

there are only 2 other files that have if statements than can reduce to ||, and there is not much cases of them

#

for the other files i might reduce them, but the cases in drawman.c are intentional

stray latch
#

A windows 10 compatibility layer well all I can say is best of luck man hope you can somehow survive that programming hell since that means you have to support ... windows.h dun dun dun no but for real I feel bad for you for having to remake windows.h.

exotic lintel
#

COM and OLE are where it's at

tight prawn
#

Programs for windows are already compiled

livid summit
#

i think windows.h is the least of your problems if you want compatibility with windows anyway

tight prawn
#

yeah

#

writing ntdll is your problem

stray latch
#

Well they said they wanted windows 10 compatibility which means they need to be able to reverse every single bit of windows that notepad relays on. And how would they even do that like would they make apps run on the OS itself or on a wine like app.

tight prawn
#

Notepad probably encompasses a lot of stuff

misty token
#

port Wine halfmemeright

livid summit
exotic lintel
still pebble
#

isnt it just a bunch of syscalls, dll support, and making some system dlls and making a pe file loader

#

and I wont have to write windows.h because I will not support compilation for windows programs

snow cloud
#

To be honest I have no idea about how stuff like that works but it seems like if it were that simple we would see more people implementing Windows apps' support. I could be wrong though

stray latch
#

Oh I thought you wanted to be able to like build and run windows apps

snow cloud
#

I really don't want to sound discouraging and pessimistic and I'm sorry from the bottom of my heart if I do but I mean there's the ReactOS project which has lots of contributors and they've been trying to get Windows stuff to run for years (edit: it does run but it's far from perfect). It's a very ambitious goal what you're talking about

#

But if you're up for a challenge and don't necessarily aim for something perfect, then that's a fun project indeed, best of luck!

exotic lintel
#

Basic Windows stuff probably isn't that difficult. You could run most 1985-1993 Windows apps within a few months

snow cloud
#

Yeah, sounds fair enough

exotic lintel
#

But after win95 things take a complication turn

still pebble
#

like browsers

snow cloud
#

yeah I get what you're saying

still pebble
#

there is a guy who made windows xp notepad work in 30k loc of just assembly

#

so this shows me that its not toooo ambitious

#

but I am attempting to do win10 which will introduce many complications

#

but then again, you dont do osdev to do things the easy way.

sturdy swallow
#

the thing is that the windows usermode dlls have a ton of functions

still pebble
#

I'm thinking I can look at the symbol table of notepad's PE file and just implement the symbols it uses

sturdy swallow
#

yeah you can do that, but its still likely a good amount

#

also one recommendation: don't put nulls into the import address table entries KEKW because that makes it very painful to see which function it called, I did that mistake

tight prawn
#

just go for it

stray latch
#

I mean you could target windows 1.0 notepad instead

#

it would be faster but not as good

#

faster to make

#

and run

woeful rover
stray latch
#

I forgot /s

woeful rover
#

i hope so

#

it would be quite tedious to support running win16 apps

stray latch
#

True xp on the other hand

proud pecan
#

You'd probably have to support both 32-bit and 64-bit DLLs to support modern windows programs

#

As iirc, some applications use both 32-bit and 64-bit DLLs

#

Nvm

#

I forgot that that would be practically impossible

slim edge
#

a good chunk of windows programs are 32-bit still though

#

even ones shipped with windows afaik

tight prawn
#

Steam LULW

still pebble
#

This is what I think is the symbol table of Notepad, which doesnt seem like tooooo many things

#

well, its quite a lot actually

proud pecan
#

every heard of: objdump

still pebble
#

i dont have it

proud pecan
#

No WSL?

still pebble
#

i have wsl but i am lazy

proud pecan
#

You'd really rather see that garbled mess than type two commands

still pebble
#

inspecting notepad in notepad is what god intended

proud pecan
#

Where even is notepad

#

located

#

(filepath)

still pebble
#

windows/system32/notepad

proud pecan
#
objdump -tT /mnt/c/Windows/System32/notepad.exe```
#

wait it doesn't work

slim edge
#

-x should work iirc

proud pecan
#

Is notepad stripped?

still pebble
#

its divine intervention preventing you from doing such acts, you must use Notepad

proud pecan
#
llvm-readobj --coff-imports /mnt/c/Windows/System32/notepad.exe```
slim edge
# slim edge `-x` should work iirc
$ objdump -x  ./.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/compatdata/1493710/pfx/drive_c/windows/system32/notepad.exe

...
There is an import table in .idata at 0x14000c000

The Import Tables (interpreted .idata section contents)
 vma:            Hint    Time      Forward  DLL       First
                 Table   Stamp     Chain    Name      Thunk
 0000c000    0000c0c8 00000000 00000000 0000d208 0000c510

    DLL Name: advapi32.dll
    vma:  Hint/Ord Member-Name Bound-To
    c958     253  IsTextUnicode
    c968     391  RegCloseKey
    c978     398  RegCreateKeyExW
    c98c     436  RegOpenKeyW
    c99c     446  RegQueryValueExW
    c9b0     463  RegSetValueExW

...
still pebble
#

inspecting steam proton notepad i see

woeful rover
#

might be less painful to go with the one from before the rewrite