#Nullium
1 messages Ā· Page 2 of 1
im done with the powerpc bullshit ima go back to actually writing code
Fire
ok so i moved grub to userspace for efficiency and speed
the gdt is now on a separate computer and has to be loaded through a network protocol at 1 byte per hour
if an error occurs a robot spawns in and lights your house on fire and shoots you in the head afterwards
also trying to add paging now
be me
do thing correctly
triple fault
ridiculously small font
A
very smol font lol
its for a text mode
you'd see the whole universe on a single screen
C
should i make it larger though
it is a bit too tiny ye š
im gonna use the default system font for the terminal actually
its just big enough to be good
probably
and/or small enough
boot options, probably (system extensions are gonna be drivers, idea stolen from mac os obviously)
ok anyways time to actually make something
text mode option removed im gonna add another way to enter it later
also progress will slow down
sadly
nvm menu gone 
instead
like apple
"HOLD [insert key] DURING BOOT HOPE IT DOES SOMETHING
"
also theres visual output if your goofy keypress worked
i didnt steal anything i swear on my mom trust me
ok anyways im gonna sleep actual progress tomorrow hopefully
poor mom
fixed later because im stupid
poor mom indeed (i apologized to her afterwards)
im gonna consider stealing less from apple
before they shoot me to death with their big epic patents
my best idea is to remove the text because its said that extensions are off way before this
garphibc desgn
im gonna remove some of the mac os ideas
its not really gonna feel like mac os but might be similar to use
same what in the fuck was i thinking

my brain works periodically
by that i mean it doesnt
im stupid
ok im back to doing things except progress is actually gonna be slow 
almost done with paging
ok so apparently i am not making a unix im probably making a mac os and dos hybrid in some form
because no posix compliance
i mean i want to put bash on it eventually as an app
and also a terminal text mode for nerds and shit
maybe thats the unix part
but idk
classic mac os and unix is literally a/ux so its still a/ux like
probably
I mean... you could probably force bash to work on a non-UNIX system with enough effort... probably..... okay maybe not......... okay yeah this sounds sillier the more I think about it
(was classic macOS not a unix-based system?)
(no its a shitty ass cooperative multitasking thing)
ahhh, I see
was it paging or Paging that you messed up
partially firmware
Paging is easy to mess up but paging is pretty simple
whats the difference š
what do i need to run bash other than like
stdlibs
paging is just mapping and umapping pages (the act of), whereas Paging is the process of managing pages, such as performing page aging, page-out, demand paging, etc.
oh
loading in my os afterwards was the problem
...no clue, never tried to port it, never will š I would imagine it's pretty dependent on the system being UNIX though
idk
the wiki literally suggests triple faulting as a method for reboot
i would not trust it
no joke check the reboot page
already did
š„
idk why the fuck would you triple fault to reboot
lazy people
i mean its easy but like quadruple stupid
the only thing i use that for is some forms of debugging by "HMMM THIS DOESNT WORK MAYBE IF IT GETS TRIGGERED I SHIT COMPUTER"
that's certainly one of the more egregious things the wiki has said XD
the wiki says a ton of random bs other than this
that you need like 3000 years of experience
(i only programmed for directx 9 and a ti84+ ce calculator before osdev)
smells like total bullshit
I mean, you certainly need to be comfortable with a lang like C, but asking for 12+ years of experience is a bit much lol
true
i know enough c to understand everything well enough
12 years is insane
i feel like people gatekeep a lot to look smart
"you can only program if you know 3000 types of math and have 30 phd's"
I mean, personally I don't think that was the intention of the paragraph, I think it was just worded a little poorly
true i guess
it probably intents to warn dumbasses that "you cant make an os without knowing shit in a low level language" (RIS
)
except ris
it should be worshipped 
reasonable, who needs ACPI
who needs to pulse the ps/2 keyboard
you can just make your processor lose its shit
making a physical memory allocator
paging later 
(i know its fucking required or yall are gonna kill me)
I mean.... you don't have to do paging if you don't want to
let's overwrite the kernel!!!
ironically classic mac os allowed itself to be overwriten
Segmentation 
wait really 
yeah lmfao
BeOS started like this
it literally overwrote mac os
that's funny XD
i spent like 400 years figuring out how to deal with the kernel in the memory alloc thing
i figured it out just allocate pages for the kernel (damn im stupid)
divide end addr of kernel by page size and then take that many pages
not actual paging its currently just physical memory allocation
not a lot of images because no visual changes
me :3
but I had just woken up, so I was probably mistaken and deleted the msg
what was the message though im interested
it was something like "you should map some memory instead"
i has have int to ascii (binary???) converter
how do i do a regdump though
nevermind i doubt i need a register dump
i still have an itoa
is this deadlocked
guys everyone who wants to actually read the github code i am sorry for my war crimes
jk i got the best code ever 
i worked at blizzard for 90 years 
for interrupts?
uhhh idk i think i recall some people actually dumping processor registers in a kernel panic
you want an assembly stub to save registers to the stack and pass a pointer of it
mk
FUCK
itoa works now
why does it end at 0x0
wtf is my linker on
crash screen
unlike the regular one (this one has to be toggled on by user) it has more info
grammatical error is intentional i think
anyways time to do the funny memory alloc
i needed to know at what addr the kernel ends
made an itoa and this crash screen
time to stop using that fucking crash screen for tests
thought this is like ultrabullshit for a moment
apparently its not
convert this to decimal then to megabytes
terminal on the left to prove that its 2 gigs
what if i give it 4
new number
damn
LETS GOOOOOOOOOOOO
i forgot i have base10
anyways if anyone wants to know what the numbers mean look to the code screenshot
shit the numbers are cut off
now not
the left numbers are in kilobytes
the right ones are in bytes
top is total amount of ram (no shit)
so skibidi
memory management isnt as painful when you know what in the fuck you are working with
do you output to COM1 or is the UI your only way to show text?
bc you should consider having serial communication to the host
idk how to output to com1
itās just I/O, you outb an initialization sequence that sets the frequency to COM1 and then youāll be able to use the port as a bidirectional text buffer
donāt rely on it as a user input source, use it to dump info
I think arduino heavily relies on it for software flashing
idk
my logging functions print both on the āUI terminalā and on serial
yeah, just setup a BUS ethernet topology
you should still be able to log info on serial
it can save you a lot of debugging time
true
is ethernet bidirectional? (googled it, yeah it is)
10base2 
depends though
Iām not a networking expert
but
you should be able to send data to a beacon (likely your router) or another another device if youāre using a bus topology
bus topology is cool and mainly relies on protocols rather than hardware configuration
I studied it in school :)
there are lots of layers when treating networks, unfortunately
LAN communication itās already complex by itself, on top of that you have addressing protocols like IP, transmission protocols like TCP and application layer protocols like HTTP
oh god
at the end youāll end up with a cascade structure that becomes more abstract layer by layer:
LAN transmissions (a lot of theory, lots of hardware stuff)
Addressing (theory and implementation)
Transport (mainly algorithms implementation and some security related development)
Applications (relatively the easiest part, you just follow protocol specifications and implement them)
basically app wants to send thing, it goes into a queue, then it makes it into like a valid format, then it sends it through the driver? idk this is what it looks like to me
getting stuff is just that but in reverse
thatās the TX queue in ethernet comms
you want to send a packet to another host (likely the router) so itās wrapped into a {data,length,flags} structure and put in the transmission queue
sounds ok enough
thatās all I know about detailed packet transmission
Iām still learning as I write an ethernet driver
idk it sounds understandable in theory
I might have got it all wrong so donāt quote me on it, if you really want to learn more read some specification or ask someone more fond :)
more memory management:
top number is pages required for kernel
bottom number is how much memory the kernel uses
is it me or is that a shit ton
4kb pages btw
c does floor divisions i might have to round it up later
that is um
mildly different
jesus christ š
that is even more of a shit ton
wait i divided it by a regular 1000
not the hex 1000
me dum dum
ok its 1066 instead of 1065
yay
i need 1066 pages (damn)
is that a lot or did i do everything right
it includes like literally everything
like the stack and all that
you could ceil divide: #define CEIL_DIV(x,y) (x + y - 1) / y
alr done
its rounded up now
coolest C macro
real
more memory progress tmrw
you people are smart and know your shit but like i have a bitmap of 4 kb pages and like it can allocate groups of these pages and they haved to be freed otherwise memory leak
(i like talking im sorry)
i want a separate bitmap that instead tells which task took which pages
also its physical memory only currently
virtual memory is later
so if you decide to kill the task it will de allocate everything
hopefully
if something takes too much memory my only suggestion is to kernel panic the system
or just say "you took too much memory go end your apps or some shit"
windows does that
i think
triple fault it 
bitmap allocator š
buddy allocator
:0
bitmaps are egregiously slow once you have more than a few megabytes of memory
i guess
no joke it can take multiple seconds to scan through an 8gb address space
they also dont provide any alignment guarantees
buddy allocators by default align to the size specified
u should read the dedicated articles and implementations of it since those provide much more concise and thought out info whereas me yapping would sound like an unhelpful yapfest lol
but the idea is you have blocks that you allocate from of different sizes and when two adjacent same size blocks become free you merge them together into a larger block
reduces fragmentation
oh so a list of blocks
basically yea
faster + alignment guarantees + reduced fragmentation + all the cool kids use it
it's a win win
linux etc
true
wait im allocating pages though
ima still use it idk
oh
WAIT HOLY SHIT
i wanted to make that at 3 am
or something
idk its partitions
š„
@wild glen checkout my gui
kernel window manager
most informative kernel panic
the color palette is a bit goofy but its cool
guys rip the 4 kb of ram that is never going to be used in the os
and the first two megabytes of ram as well
hlep i need this number divided
what can it be divided by
actually fuck it more than 4 kb is lost
at least 8 
Siegma
idc about anything until this number is divided
or not all memory would able to be used :(
fuck it im fine with losing 8 kb
its not that much
instead of 1047920 pages it now can scan 261980 instead (buddy allocator, i think, it's like a directory tree)
do i need to reduce that number more
1
no shit
523961
yes shit
he smort
math
anyways
im doing more directories 
directoriesā¢
the buddy allocation of all time
(i know this is 4 gb in pages, some of them are going to be blocked out depending on how much memory is in your pc)
(this should work fine for 32 bit)
( i think idk you people reading this know way more than i do )
i suck at thinking so i just booted up the fucking scratch editor
idk is this how buddy allocators work im braindead
shouldve used a spreadsheet editor actually
i might be making something else
whatever im just gonna write a fucking memory allocator on scratch first
then port it
im geniunely too stupid to write it in c from the start
Just write in pseudo language
na
^
if i cant get figure something out i write it in psuedocode, sometimes port parts of it to a scripting language
like python
LMFAO
gold message
are you writing a PMM or a heap allocator?
uhhhhhhhhh
currently a pmm
i wasnt at home for like the last 2 hours
oh wait im making something else
yeah im reconsidering life choices š„
buddy allocator time
goated
i made a buddy allocator on scratch 
context: lol no
ima post the project file once im done with this fuckass
its gonna be ported into my os
there's no structs in scratch i cant make an array of structs tho
its gonna have structs in c dont shoot me to death
to have it make more sense i have to use a sorting algorithm
wait i found a bug
j
i have to do a sorting algorithm
F
its for easier merging of free memory blocks
oh wait
ok its not a traditional sorting algorithm
its a filter
it finds free blocks in the list
puts them on a list and then merges the ones close by
you typically just check if you can merge upon free instead of having this as a separate thing
let's say
allocate 1 page, call this LEFT
allocate 1 page, call this RIGHT
free LEFT, check if we can merge -> we can't merge
then
free RIGHT, check if we can merge -> we can -> merge it with LEFT
true
what if free segments are fragmented tho
how the hell are you going to fix something like this
(scratch because im still not done with the testing shit)
you always allocate with sizes that are powers of two
that's the caveat of this all
you merge 1 and 3 to make 0..100 of size 100 and type free
true
ok i think i figured out how to do that
thats what i was going to do either way but i think i figured out how to program that
have a blast š
aight
why don't you use a bitmap
it's very unlikely that you'll need a buddy allocator for pmm
he said the reason why afterwards
having a buddy allocator as PMM it's a nice flex but also a pain inthe ass to write
this could be considered incitement to suicide
false propaganda from Big Bitmap
memory allocation wars
overkill
now my buddy allocator is not good and it has a Big Function Lock, I'm planning on parallelizing it soon
same
my only problem is merging really and i think i solved it
but it is a buddy allocator
I'll also be doing processor topology representation in software soon (getting it figured out) so I can make it NUMA aware for fun
I like segmentation when allocating heap instead
why is it overkill
it genuinely isn't bad
"Having performant code... overkil...."
š
booting from rom
propaganda solved š
Booting from ROM...
why isn't kernel.c booting
plus who tf writes "file.C" (with capital C)
braindead people
michael soft
i said michael soft not microsoft
microsoft doesnt code like that
michael soft might
his brother, michael hard, works on electronics
facts
binbows
literally no.
even then, a simple freelist allocator is much easier to get right than a bitmap allocator anyway
Freelist my beloved ā¤ļø
memory allocation wars
busting the bitmap propaganda
what complexity do freelist and buddy allocator have per allocation?
buddy allocator starts with one big ass free space, then it just gets cut and the new space is treated as "used"
see this image
merging two free entries is a pain in the ass though if you dont know how to do it
Buddy is just division by 2
Free list is just⦠a free list
so O(log N) worst case
show me, I'm falling for buddy propaganda
freelist is always O(1) for alloc/free, atleast if you only do page sized allocations. You can get away with scanning the list though, for higher alloc sizes
this is the most stupid code ever
anyways my buddy allocator works i can port it now š„
(i should port my os to scratch
)
this is the scratch project file for the buddy allocator test thing
yall can do whatever you want with this (its a theoretical simulation of memory)
golden
im not sure if this is public shaming or is this the most random shit ever
nah it's just a meme
fair
Dam
there's also the "Do not" error
booting an uncompiled c file is crazy
even though this was already discussed
its still insane
going through a rewrite might be the best thing I've ever done
of your memory manager?
of the whole kernel
oh
the best thing i did is to scrap my shitty vga text mode os because half the code was stolen
this one is my actual try
on top of that uacpi was crashing, something was breaking somewhere and I couldn't find out where
rip
75% 
i was also following the shittiest tutorial on earth
I can finally define a virtual memory layout
your progress report thread became misc0
i permit it lmfao
this went from buddy memory allocation to kernel rewrites
if you want we can go to misc 0 idk
I think I'll go to sleep, keep reporting progress and I'll keep posting in the thread :)
aight
gn
do i still do buddy allocation with pages
fuck it ima do it with pages
The
ok anyways
ported struct
I LOVE THE ITOA FUNCTION AISKJDHAFHQUJKRHQWUJQWMNDHGIJSEKFQWIL>WQKHJDQWHJKD
anyways i can add malloc now
i made it horizontal
i want to print all the values in the list thing out
debugging š
it allocated yay
function for it
it shouldnt return 0 but whatever
lemme make it not return 0
this is page allocation (palloc), malloc will return the actual memory address
idk if its called palloc usually
i just named it palloc because page allocation
mac os clone
looks inside
windows nt
it isnt intentional
how does winnt code even look like
true
idk i remember seeing directx instructions like that
with these function calls
i think microsoft made them
these functions were long as actual fuck
idk i just code functions with a lot of parameters like that now
No nt style would be
NT_RESERVE_PAGE_ALLOCATOR_HELPER_FUNCTION(...)
NT_RESERVE_PAGE_ALLOCATOR_HELPER_FUNCTION(
a,
b,
c,
d,
e,
f
)
yo guys so like heres my plan (in order)
- memory management
- more memory stuff (paging)
- scheduler
- hard disk access
- window management
- file systems
- programs
maybe swap fs and window management
did you already do the scheduler?
no
so that is like a really really big deal
do you want multitasking in this project
ok yeah add the scheduler to that list then
and you'll also want a side dish of synchronization primitives to go along with it
condvars, mutexes, semaphores, blah blah blah
also you didn't seem to know what a spinlock was before this, I suggest you definitely look into multithreading and write multithreaded userspace programs with pthreads in C
i use interrupts for the mouse pointer already
a
sure the concept is simple but once you add many layers on top of it things can get complex
like with mutexes
fair
a simple mutex is, well, simple
but if you have thread prioirities, then you might introduce priority inheritance, and then if you want pointer sized locks, you need per-thread turnstiles and a global turnstile hash table
fair
cringe, I atomically lock the spinlock and stop the whole scheduling system
do you not use locks anywhere else
wdym
not currently
how is your os functional
I lock the spinlock in critical functions like allocators
the scheduler notices and doesn't switch task
it is a BKL
crazy
I'm not even planning on adding SMP
your loss
what in the fuck happened
also
i am tragically informing you all
about the lack of the cd-rom, the box, the manual, and swiss cheese in the nullium cd set
no warranty included either

in the digital edition swiss cheese has to be removed as well
i couldnt afford the free version of chatgpt so i have to inform you people about this tragic loss not with an essay
but instead 8 discord messages
to protest this crime cheese react the thread
or something
Nice
i wanted to add tetris except the company making it will not like it
at some point
in the os bundle
which is a major ass disappointment
Did you fall for my buddy propaganda
Thatās not an os thing tho
Like
Just create a kernel
And a userspace
Then just make your own Tetris game in c in userspace
Running Tetris in the kernel is
Bound to cause maybe a few issues 
i know
thats what i wanted to do
the company will still not like it
the tetris company
i have to license it for all my money
times 5403002
idk i dont want to run tetris in the kernel no matter how goofy asf that would be
he did i think
i remember a guy writing a tetris os
there was a youtube video or smth
yeah
there is thois popular programming youtuber who did it
fair
youtubers suck at programming always 
except terry davis (brainfart)
he was a streamer though
you should help me with the ui of my os
at some point
when i reach userspace again
why me lmao
because your shit looks great
thank
lemme finish my homework rq i can actually finish my crappy mem allocator (PALLOC MAUAHAHAHAHAHAHAHAHAHAH how did people live with 6 letter labels)
no youre good, just at some point id be interested in that
if you need help with your allocator let me know
i have the buddy system implemented and i know a decent bit about it
fair
i have a scratch project for it for some ungodly reason
you can scroll up and find it
yeah i saw
sometimes we need visual representations for some concepts
i used scratch to help me implement virtual memory
no shame
easy to understand lego programming language that doesnt need to compile
shit has more debugging tools than visual studio
yeah its elite
fr
damn
int clone_pagemap(uintptr_t src_base, uintptr_t dst_base, size_t size) {
size_t pages = _align_up(size) / PAGE_SIZE;
for (size_t i = 0; i < pages; i++) {
uintptr_t src_vaddr = src_base + i * PAGE_SIZE;
uintptr_t dst_vaddr = dst_base + i * PAGE_SIZE;
uint32_t src_pd_idx = _pd_index(src_vaddr);
uint32_t src_pt_idx = _pt_index(src_vaddr);
if (!RESOLVE_RECURSIVE_PD[src_pd_idx].present) continue;
pte_t* src_pt = RESOLVE_RECURSIVE_PT(src_pd_idx);
if (!src_pt[src_pt_idx].present) continue;
uintptr_t src_paddr = src_pt[src_pt_idx].frame_addr << PAGE_SIZE_SHIFT;
page_attrs_t attrs = {
.present = src_pt[src_pt_idx].present,
.rw = src_pt[src_pt_idx].rw,
.user = src_pt[src_pt_idx].user
};
void* dst_frame = pmm_alloc_page();
if (!dst_frame) return -1;
flop_memcpy(dst_frame, (void*)src_paddr, PAGE_SIZE);
attrs.frame_addr = ((uintptr_t)dst_frame) >> PAGE_SIZE_SHIFT;
if (map_page(dst_vaddr, (uintptr_t)dst_frame, attrs) < 0) {
// Rollback previous mappings
for (size_t j = 0; j < i; j++) {
uintptr_t undo_vaddr = dst_base + j * PAGE_SIZE;
unmap_page(undo_vaddr);
}
pmm_free_page(dst_frame);
return -1;
}
}
return 0;
}
cancer fr
just look at any vmm.c in any os
its just fucked
i added a bunch of protections features too
my shit is 1k lines of code for no reason
ok now im scared of adding vmm
oh ok
for a "vmm"
true
so you need a pmm
i still allocate physical memory
then make it pretty to make it virtual
i guess you can say it like that yes
idk
not sure but iirc paging or whatever allows to like block off access to the kernel in user space
yes
isolation
from yesterday i have this absolute fart
beatiful
doesnt map actual memory addresses actually
valid? free? š£ļø
im gonna add a parameter in the struct for that
valid? free? owner size start
mem location
first is base16 second is base10
too much effort for a debug table that will get sent to the shadow realm shortly after using it
i need to write a spreadsheet editor for nullium after i get to userspace and shit
size is in pages btw
I think youāre overthinking alot of this
Wanna look at my impl
No this is good
This file is a banger
truly
i made an allocator that cuts exactly how much you ask instead of just the middle
:0
Because buddy blocks are supposed to be powers of 2
But
Itās fine lol
No one cares
i did
then what did i make lmao
So who cares
Idk exactly what that would be called
Someone with more knowledge than me could probably tell you
next is an actual VMM that divides memory per region
i mean its like hard disk partitions
Day #294839272837 of people not knowing what a vmm is
thatās the only place I know where I should put a virtual address region map
damnit
Which is cool
not damnit
tried to write a buddy allocator but i got a freelist ;-;
im this bad at understanding things
educate me please 
Itās an abstraction of physical memory
someone teach me to read outside of school man this is absolutely braindead
lmfao
anyways
Meaning that it presents memory to applications and the kernel in a way to where each process has its own āaddress spaceā
which is where I should divide virtual address spaces, no?
exactly
What do you mean divide virtual address spaces
Dividing what
(#osdev-misc-2?) /j
mapping more than dividing
Well then sure
Mb mb
My thread has a lot of that happening sometimes
fair
Itās mainly just me being schizophrenic tho
shit happens š
Good
indeed?
Lol
The
id say it works
would these interfere though
actually nah ion think they would
tell people "size means end address"
Pmm lore
ibm ultrabay specifications when
it can merge now
before:
after:
time to test it
add a few memory segments then do stuff to them
so the merger works fine
except it doesnt merge all the free segments
ж
Why is size the same
are you sure
look closer
im done with page allocation
yay
do i do paging next or do i add a malloc()
Wait nvm
Paging
You need that anyway to make a proper malloc()
Yeah thatās fine
Although
A good kernel heap allocator is really nice
Because imagine you need a 30 byte allocation
You would do a page alloc
And waste
4066 bytes
With only 3 being used
Internal fragmentation
rip
do what
not do the heap allocator or do it
Not do it
i think i can do a heap actually
theres a point in it
other than you telling that all the cool people are using it
github push
added physical memory allocator
No itās just logically better to not waste a page size worth of memory every time you need an allocation
Like
Imagine how many small allocations there is for thread structs
Imagine each of them taking a whole ass page
im gonna make system processes use cooperative multitasking
this only includes the file explorer (im gonna call it the browser for shits and giggles) and system menu and error messages really
nothing else
no preemption?
crazy
thats for literally everything else
huh
absolutely everything except the fucking file explorer is gonna be preemtive
what
did classic macOS/aux even use pre-emptive multitasking
I don't think so?
it didnt lololol
nope
so if this is a/ux style co-operative multitasking is fine š
true
a/ux was a unix though
i just realized this shit will not be a unix š
maybe i should just make it a classic mac os-like os
im just gonna keep the classic mac os part of it
theres still gonna be a text ode
mode
and bash
and shit
UNIX is overrated 
indeed
Nullium - a classic Mac OS like OS (some unix elements present)
more accurate
its gonna have preemptive multitasking
but the file explorer is just built different
how do you load paging
or like a page directory
how do you even use this shit afterwards
im confused
the article on the wiki (osdev.org) uses gas while i use nasm
just convert the syntax
wtf is 8(%esp) supposed to mean in nasm
i can understand everything else
mov eax, [esp + 8]

tmrw im gonna fix my shitty paging
apple's liquid glass looks like total farts imo so im gonna make a cooler one 
like excuse me what the fuck are these icons
should the menu panel be at the top of the screen
note that even if it was at the bottom it functions nothing like the windows one
fuck it im moving it up to the top
š
i dont want my fucking kernel to be rewritten by a program that wont be exactly cash money
i really just want this specifically
i dont care for anything else i want isolation from the kernel
Segmentation 
Donāt even
Stop right there
š
i forgot what that
good, keep it that way 
The memory management strategy before paging
Even tho paging existed for 30 years before intel started supporting it
We took a big ass step backwards
Yeah
We had paging computers in the 60ās
And Intel didnāt support it until the late 80ās
hardware or software
Uh
386 moment
Thatās what Iām targeting
Although paging was still optional
You could still do segmentation
For example Microsoft DOS used segmentation
I wouldnāt even call Dos an os in the traditional sense lol
I mean I guess itās an os but itās pretty useless compared to most operating systems
Thereās no multitasking, no memory protection of any kind, only ring 0, lack of hardware abstraction
Linux is notoriously bloated lol
ok true lmao
I main the core kernel code is good for sure
But drivers/
Is just fucked
Also just the naming on the drivers too
that folder is ultimate abomination of intel, nvidia, ati, and 5000 shitty programmers
Wtf is half of this shit
half is an understatement
this is like reading chinese
what the heck is allat 
nullium goal 2: dont make the driver folder look like the one in linux
(the first one is to make it look good compared to mac os 26 (just call it 16 god fucking damn it))
sane
okie, see, that makes sense
I feel like these folder names should be EASYto understand
mine looks like this
some drivers are in the arch folder
these are somewhat universal
as in they work both for x86_64 and i386
Mmmm
You drivers shouldnāt be arch specific period
I have yet to get to the point of having any drivers lol
is gdt a driver
its really just boot init stuff
No itās an array of integers
congratulations
i did everything right
in the arch folder is just paging (ptsd), gdt, idt, system entrance etc
thats what outb is
so the evil ps2-x86 will work on literally anything if outb gets ported to [insert whatever]?
awesome
X86 is definitely a mess tho
I feel like any big hardware/software will be messy
Like the Intel SDM is extremely cumbersome
To read
And a lot of the mnemonics donāt even make sense
false
ARM has no in/outb
the IRQ abstraction here is also x86 specific
Oh yeah mmio I forgot arm does that
you'd want ps2_read/write functions that compile to in/out on x86 and whatever else on ARM
so this code is correct for being PS2-x86.c
Yeah true but it wouldnāt work for arm
you wouldnt entirely rewrite it for Arm, you would just introduce arch-agnostic abstractions like a ps2_read/write
IT TRIPLE FAULTS AGAIN
IM GONNA FUCKING KILL SOMOENE
is there any fucking sensible instruction on paging anywhere on the fucking internet
Not really
Show me your code
Maybe I can help 
Nah but fr I can try to help
a sec
unsigned long *page_directory = (unsigned long*) 0x9C000;
unsigned long *page_table = (unsigned long*) 0x9D000;
extern unsigned long read_cr0();
extern unsigned long read_cr3();
extern void write_cr0(unsigned long);
extern void write_cr3(unsigned long);
void init_Paging(){
unsigned long address=0;
unsigned int i;
// only first 4mb of memory
for(i=0; i<1024; i++)
{
page_table[i] = address | 3;
address = address + 4096;
};
page_directory[0] = (unsigned long)page_table;
page_directory[0] = page_directory[0] | 3;
for(i=1; i<1024; i++)
{
page_directory[i] = 0 | 2; // attribute set to: supervisor level, read/write, not present(010 in binary)
};
write_cr3((unsigned long)page_directory);
write_cr0(read_cr0() | 0x80000000);
}
followed the thing on the bona fide osdev site
this is total farts
global read_cr0
read_cr0:
mov eax, cr0
retn
global write_cr0
write_cr0:
push ebp
mov ebp, esp
mov eax, [ebp+8]
mov cr0, eax
pop ebp
retn
global read_cr3
read_cr3:
mov eax, cr3
retn
global write_cr3
write_cr3:
push ebp
mov ebp, esp
mov eax, [ebp+8]
mov cr3, eax
pop ebp
retn
assembly
your implementation is somehow way simpler than whatever the fuck everyone else is doing
@hushed briar