#MINTIA (not vibecoded)
1 messages · Page 5 of 1
they subscribe to an ideology thats literally called "smartism" and developed by weird crypto-nazi bloggers so it shouldnt be surprising it attracts mostly this kind of dumb person
theyre elon's favorite type of useful idiot though so its funny to see the language being used to shit on him
i mean
you can tell by what Musk does and says that he's definitely not a genius
he's just smart enough to scam everybody but one day the tide will turn on him
absolutely lol
I wasn't defending him at all I was just ALSO insulting this person
lol fair
Regardless of whether he is smart / has a high IQ he's clearly also pushing his own agenda and exploiting his power and money
smart != wise
There are lots of smart ppl that are also insane
Ted Kaczynski was also smart
elon musk is cool and deserves to be unelected god emperor of earth because tony stark space X diablo II megagamer god
can I go on a warm take for a second, I have how this administration is calling everything czar
like, the border czar, the market czar, the internal affairs czar, please, shut the fuck up, just call it an actual term
that's like an American thing
if not generally an anglosphere thing
we call ppl czars in politics for some reason
your culture is rotten if that is the case, and you get what you deserve
republicans against trump dont exist
Usually someone appointed specially to deal with an ostensible or real crisis
or other special circumstance
why not call them idk, head of the whatever comission
or like something more descriptive
It's not like a real title though it's like colloquial
This is their official title probably
you mention someone is a czar im imagining you as a 13yo commie on the internet posting memes of whoever the czar is pasted on communist propaganda
its innate
But we call them the border czar instead of the Head of the Commission Appointed To Resolve The Flood Of Illegal Immigrants Across The Border From Mexico or whatever trump called them
Don't commies hate the czars
I think they notably shot the last one in a basement
Term also used here but probably an American import
them being called "czars" is proof that the US has been a monarchy all along /j
yall think it makes sense to require special privileges to raise your own priority but not to lower it
yeah, because lowering your priority is, in a way, voluntarily giving up resources (CPU time) to others
depends, can lowering a task's priority hurt the system
the reason these things have permissions attached is because DoS potential
if there is no DoS potential, then you dont need one
ig at least such that its impossible to change the priority of threads of other processes
yes
well you can if you have a handle to it with the appropriate permissions
i didn't notice “own” so ig not
also there shouldnt be one privilege for all priority levels like
a process shouldnt go "oh i have the privilege" and max out its priority
yeah i was gonna split out a privilege for the real time priorities (upper 16) vs user priorities
maybe allow only changing some sort of priority classes like low, medium, and high
why would regular apps change their priority
to be nice
if lowering a process's priority doesnt require permissions then could a malicious program lower the priority of all system critical processes to get more time for itself?
i mean change the priority up
permissions =/= privilege here
privilege is a diff thing, basically im having each processes have two privilege bitmaps. a "set of privileges i have" bitmap and "set of privileges i've enabled" bitmap
you can enable any privilege in the former bitmap
but the enabled bitmap is reset in each new process
so you have to explicitly enable a privilege before u use it
doesnt sound like a useful security measure
unless you're trying to prevent your children from accidentally doing shit that they arent supposed to do or smth
for 1 it makes it more difficult to do arbitrary stuff if you manage to get a privileged process to do stuff it shouldnt
for 2 it makes it more difficult to accidentally do evil shit as a privileged process (which is similar or the same as #1 if its being caused maliciously)
void malicious_hook()
{
enable_bitmap_bit(DELETE_MINTIA_PRIV_DONT_ASK_WHY);
delete_file("rm mintiaosexe.exe");
}
"making it more difficult" doesnt really matter, it'll get done anyways
for security i would aim to make it impossible / possible
though it does make sense for #2
but then you have to consider the ways a process could accidentally do evil shit
idk if this extends to file perms but maybe you could prevent processes from accessing files outside of the executable directory unless a certain priv bit is set
which could prevent situations like rm -rf / home/will/mathassignmentcalculus
youre talking about something similar to unveil()
idk what that is but presumably it's better and more flexible than what im suggesting
Is there any reason why you don't go for a capability based design?
Ambient authority has a lot of problems so relying on it for a new design seems strange to me
ambient authority is nice to have on top of an existing access control mechanism
its useful to be able to say "dont let me write to this area of the filesystem" or equivalent
if you make the permission bitmap a write once afair then you've basically got seccomp
i have that
privileges are more coarsely for "can i do this system service [with these flags] at all" basically
on top of capabilities with fine grained permissions
Ah, i see
glad i invested in fancy mutexes
now i dont have to feel guilty about wasted space from spamming them everywhere, cuz theyre all just a single pointer
would have been tempted to do broader locks for certain things otherwise in order to save space
in old mintia i had a goal of 1mb to run in multi user headless mode
minimum
512k is my goal this time
at least for uniprocessor
the smp build might not fit in that
but if you have an smp system you probably have more than 512kb ram.
making an smp computer with only 256kb ram just to spite you
Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
264kB on-chip SRAM
it does not have a real MMU tho
well the mmu is kinda important for even hoping for 512kb
need pervasive swapping for that
would it be possible to fit an entire OS in 2 pages
based entirely on swapping
huh
like
have all the features of a modern OS
but you only have 2 pages of memory
that does not sound possible no
it doesnt have to be fast, it just has to work
most of the modern features are to be faster
i dont think that matters when you're talking about a hypothetical like this
and it has to be completely transparent to the user programs
so it should create a facade of having an actually big virtual memory space
assuming youre not counting page frames required to be permanently resident like architecturally
nvm
its not possible no
at least one of the page frames needs to be resident permanently to contain the page fault handler
and the disk driver
u have 1 theoretically swappable page frame
you need at least one actual page to hold the data that gets swapped in/out, and I don't think all the memory management and disk I/O code combined could possibly fit in a single page
possible? maybe, but very impractical and not a good idea
this would be for a custom arch so in theory you could make disk io easier
it does have an mpu so you could still try some memes with the bus fault handler
and if you want to have a full featured os you have even more to fit in this page
"all the features of a modern OS" no not really possible
yeah, in that case, hard no
for example on x86_64:
- it's infeasible to have an IDT that has less than 256 entries
- the entire IDT is inherently required to be memory resident, so can't be swapped in/out
- a full 256 entry IDT already occupies an entire page
.
then code size is less of an issue yeah
but I still don't think it's really possible
the memory manager itself requires dynamically allocated data that cannot be paged in/out
u also need to fit everything depended upon by the memory manager in the permanently resident page frame
so the schedulers in there
and you have "modern os features" so its a multithreading scheduler with priorities and fancy policies
ok hear me out
if you keep a cache
and have that cache be 16 kib or something
you could technically use it to store extra code
by swapping it in, putting it in the cache
and swapping it out without evicting the cacheline
this discussion is getting like annoyingly contrived
specifically cuz somehow that 16kb cache doesnt count as memory even though its literally memory so you immediately invalidated your original premise
"its not possible"
"what if you add more memory"
well yeah then i guess its possible. but thats like. not interesting
on a lot of architectures a single instruction can require more than one page to execute in the worst case
this is gonna be a custom arch
then its boring
yeah i get what you mean
well, why do you need a 256 entry idt? Just use a 32 entry idt and handle the faults
There is definitely hw that needs to operate on more than one page to work though
fair, still eats up 1/8th of the page though
yea
it's not feasible on real archs
on custom archs it's feasible because you can just add magic to the arch to do it
but as pitust said, it's boring in that case
by custom arch i didnt mean just adding features to bullshit around the challenge
just something that removes hardware impossibilities without trying to make it easier
@acoustic sparrow i almost gave you an easy one https://github.com/xrarch/mintia2/commit/67eafeb7d5d1d23740a36c83114da10c593c7aa9#diff-0d246578b6c1fe80ecda9314f11438c5567a24d8507daf4d39aced385e63d5b1R752-R754
the absence of this check would have allowed accesses to arbitrary kernel memory if i didnt notice it lol
do privileges > OS_PRIVILEGE_MAX allow such accesses or what
😦
although its mintia2 and i mean. the competition is 6th to 8th march
why isnt this two separate commits lol
I expected more from the man himself
commits are stupid
reject version control
return to tarball patches over email
do it like ncurses and publish patches in tarballs
I think they have a repo now but they unironically still did it like that a few years ago
what magical force makes it have to be two commits
often I just run into something while doing smth else and fix it right then and then it goes into one commit
common sense
This would never fly if you were doing osdev on a team
So it's useful to keep a commit hygiene especially if u don’t have commercial experience
I wouldn't be writing a whole brand new kernel either
Im not sure why that matters, in this case its a bug fix and a random new feature both in one commit
I thought u were more serious about it is all
This is trivia
This entire part of the project is a boring formality anyway basically
Actually writing down stuff I already knew how it'd work for like 2 years
why are you doing it if you consider it boring?
Bc it's a prerequisite for less boring parts
(Memory manager and IO)
By "this entire part" I meant the bucket load of process management syscalls
The parts that are rly new to me are the smp scheduler (already done), turnstiles (done), and then aping UVM concepts for the memory manager and also designing async STREAMS-like junk for character devices in the IO system
Those are the fun parts
was scheduler an interesting part?
Yes
gotta write messages so long they don’t even fit in the terminal window!
is this an attempt to cope
on whose part
cogolein
It would have been more hygienic to do two commits for that but I also literally don't care and don't think it mattered
I do patch bombs sometimes
when im too lazy to interactively rebase so that it appears as a series of concious changes
do you write big commit messages?
generally not
or does it make sense to write big commit messages?
when its warranted for
like if it's uncler for example why something is removed, how a bug is fixed, what the feature added is for etc
so if your project is "serious" they generally should be detailed?
you will thank even yourself for that later when u do a blame to figure out why some line of code was added
yeah ofc
that how i udnerstood cogolein's message
or at least atomic
will has detailed comments which may explain a lot of stuff
you can open a commit and check if any comments changed
that works too
Obsessing over commit hygiene would prob discourage me from making tiny improvements (adding comments, bug fixes that affect a few lines, etc) where I notice them in the middle of doing other work cuz it'd be way more annoying
So this way is probably best for my hobby project
You shouldn't take me as like a Gordon Ramsay of osdev anyway cuz im not gonna be perfect ive committed some real stinkers in the past
Also never worked professionally as a programmer before
I just care minimally about like robustness and not littering my kernel with trivial DOS attacks and oom panics and stuff
Which everyone should
imo thats like half of the difficulty of the engineering parts lol
or more
fair fair
I think most ppl get lost at the part where half of everything has to return a status and everything that calls it has to handle it when that status is an error
Cuz that's tedious and they just want to "get it working"
@dense vigil honestly i find it hard to do small commits when starting a project
But then that precludes doing other interesting robustness work after you wrote tens of thousands of lines without worrying about error statuses or with highly inconsistent/ineffectual handling
So it just snowballs until it's hopeless forever
in most hobby kernels
thats true
usually the foundations are very entangled so you cant really commit it piece by piece
but u gotta remember
they dont have to be small literally
they can be 200k lines of code
if it adds one driver for example
Error statuses aren't the hard part of robustness btw they're just the like very first prerequisite
That I think most ppl don't think about cuz they find it boring and that ends up being the root cause of their kernel being super unstable way later
me when malloc(1000000000) panics my blazingly fast hobby microkernel and corrupts the mounted filesystem
serenity vibes
Or redox
lol
I thought of redox
sadly every part of the call stack has to handle the possible error(s) of the one above it
which isnt especially hard to code
but people just dont care
theyd rather panic in the lowest layer than propogate that error
Even if you handle error statuses perfectly, error case design can end up being rly intricate and easy to fuck up especially with like memory managers when swapping gets involved
if you're trying to develop an OS that markets itself as being competent then you should already have the ability to solve these problems
if you dont have the ability then you just end up speedrunning to a fancy GUI that shits itself when a program touches it wrong
actually wait how many of the hobby OSes that cant handle errors properly actually implement swap lol
I'm still unaware of any with a full page swapping impl other than minoca and old mintia
It's a very rare feature
Both of those two also have a paged kernel heap
Only old mintia has paged kernel code, about half of the kernel's pages were swappable
For whatever use that is
Lol
Keyronex had/has it at least partially
It has it thoroughly but with dubious working set adjustment currently
But certainly the swap out logic is there and thoroughly tested and extends to the page tables themselves
and the snowball doesnt stop in the kernel
hobby OS userland does not handle OOM well much of the time either
like mlibc, which panics on a mmap returning ENOMEM for its malloc implementation, even when the rest is fine
very few userspace programs need to handle oom at all
thats a choice for the userland program to make, if a game wants to panic on OOM, thats their choice
but core libraries and stuff should handle it fine
That can simply be fixed
Nobody made a bug report for this so far and changing it requires only a few lines of code
yeah for sure
the point is not that mlibc sucks and it is unfixable
the point is that these things usually are not checked against and can go undetected for a while in hobby OSes
ill submit a bug report
solaris fireengine also doing this model
i believe there is a strong case for this approach on a per stream stack basis
i believe it is adequate to have serialisation on that granularity because a) of the asynchronous nature of processing, so there's no blocking to sadden your eyes over another thread not being able to do processing, and b) that plus the fact that it is now a universally acknowledged good that processing of a packet on all levels of a TCP/IP stack (and this goes just as well for other stacks) should happen on the same core, you'd really only be facilitating between-core parallelism by having a finer domain of serialisation
i dont like how this has like at least three different ways to say enqueue
"enqueuing" "enqueueing" "queued" "queue"
it took me a minute
that's a bit of a stinker
"enqueuing its packet, the enqueuing"
I had a goofy idea for implementing drawing in a stacking window manager
Basically have a mask bitmap the size of the display that starts out with all the bits outside the redraw area set, then to redraw each element you grab a nibble from the mask bitmap and use it to index a 16 entry table of routines for redrawing that type of thing and they inline plotting the pixels or do whatever other thing (probably automatically generated for like drawing fonts and stuff, handwritten for lines and solid rectangles). You set the corresponding bits in the mask bitmap when you're done doing this and repeat until you reach the back
U skip any 0xF nibbles
You'd probably not have this as a generic loop and instead dispatch to a routine specific to that element type because if it's like a line it might have special knowledge that it can skip a bunch of nibbles
Or it might have a better way just generally
This would also be low level and you'd still have clipping regions and stuff on top
You'd just use them to initialize the mask bitmap
Arguing on the internet.. 😅
The dog on the left barks with hitler's voice
he will build a kennel that will stand for 1000 years
where did you read this btw
solaris internals (the opensolaris edition)
what does it do with multiplexer modules
in the TCP/IP stack specifically? the way they were implemented before (requiring mutual exclusion within the queue) was the main reason fireengine was created, it scaled poorly
and in general? solaris internals doesn't cover it at all
one of the papers you linked talked about eradicating multiplexer modules by duplicating more stuff iirc
will do u have the links to all those papers u have read to make mintia stored somewhere?
best bet would probably be from:hyenasky has:link in this discord lol
the wiping of the old mintia thread compromised that though
hmm ill try lol
i've misplaced my phone which is where the diagram is stored -_-
one second and i'll redraw it
fadanoid maybe u have something like that as well?
also a lot of it was books
and studying existing kernels
note the IPv4/IPv6 devices that are terminated onto the bottom of the STREAMS stacks for TCP/UDP sockets. the IPv4 and IPv6 modules, by contrast, are single multiplexor modules which terminate onto the NIC device. they are either totally mutually excluded on i'm not sure of a per-queue-pair or per-queue basis
so they are a severe limiting factor, not only for multiqueue NICs where the receive side is limiting, but also on the transmit side because every TCP or UDP packet has to go through them, and at best it's serialised per-queue and there's only one tx queue
compare that to this
here the "anchorage driver" is basically equivalent to that IP multiplexor, and in this case it's also serialised collectively with the routing, ARP, ICMP, and fragment reassembly module. but its tasks are dramatically reduced: for incoming packets is limited to either dispatching to ARP/ICMP/fragment reassembly, or to looking up which TCP or UDP streams stack the packet should go to, and putting the packet to that stack
while for outgoing packets, to consulting the ARP cache on which ethernet address to destine it to for a given IP. all other IP responsibilities (encapping/decapping the IP header, fragmenting, dealing with path MTU, checksumming, general sanity checking) are done by the individual IP modules within a TCP or UDP streams stack
so there is a case of slight violation of layering in the anchorage driver (it has to understand the basics of IP, UDP, and TCP - enough to know which streams stack to direct a packet to) in order to get away from a multiplexed architecture
i recommend btw that you do do a mintia tcp/ip stack, not just because it's a cool opportunity to exercise STREAMS, but also because it will probably be very helpful for your career prospects
Yeah that's the plan
Probably for a real nic on the amd64 port rather than a fake one on xrstation
one thing i am glad we have now, the benefit of hindsight
there are some papers from the early 90s around STREAMS and networking that get themselves tied in knots trying to figure out an ultra-fine-grained locking approach
but it's known now that the better thing is to just to try to localise processing within a single connection, at all levels of it, to one core - and then this becomes a nonissue because per-stream locking is adequate (maybe per-direction would be better but that's still in the same league of complication)
if its worth anything my kernel has an actual bibtex bibliography and i cite stuff using \cite in doxygen docs
thats cool
i would like to though it'll grow to an outrageous size
i think it would be a nice gesture and maybe even helpful for myself if i did cite everything i read contributed to such-and-such a design or whatever, it's hard to identify exactly what is the basis of everything i've added, but certainly i think it would be a great thing to try
that would be amazing indeed
why would you do that
that seems like massively slower for no reason
in other news, my osdev urge might be coming back
now that i have a relatively comprehensive explanation of paging in windows i might actually do something good
you'd have to endure the cost of one ram read, only to throw away 28 of the bits that you read, and then also have to endure a couple jumps
for every pixel that has a non $F nybble
that 20 something mhz XR/17032 CPU will have massive trouble dealing with that
(unless you somehow made jumps take one cycle)
I think you misread what I said
You're also overestimating how often this would need to be done - for something like filling nicely aligned subrectangles you'd just do a memset
This is for drawing inbetween borders with arbitrarily convoluted clipping regions
what did you say
there should be a minimum window size so you wont have regions where half the pixels are obscured and half aren't in a weird pattern
A nibble would track 4 pixels (bc 4 bits) not 1 pixel and you look up a table of function pointers with the value of the nibble and these just inline plotting the pixels with a provided color and base pointer
there is a limit to the convolution of clipping regions so i think a basic cookie cutter mechanism would work fine
You also wouldn't do a 32 bit load for each nibble... obviously? You'd do one load and then shift each nibble into place
This would all be handwritten asm
i don't understand the ultimate goal of doing this though
And unrolled to hell
Making it fast to draw around arbitrary clipping regions
how do you plan on requesting a draw anyway
do you plan on sending a message to the refreshed window with the regions to refresh? do you plan on storing a bitmap for each window?
not sure how you envision that
or maybe this is irrelevant and you're only talking about painting the stuff a window sent the manager process
I am very much not doing a compositor because I want it to fit in like 2mb
I'm doing a tree of elements server side that the client sends batched ipc messages to update; one of these can be a bitmap through a shared memory window but most of them would be predefined things like lines and rectangles and text
and I suppose that each element has to check, for each pixel that it draws, whether it's inside the clipping region?
The server would redraw without involving the client by using this tree; the client can also request a redraw of a region by sending a dirty message
The entire point of what I just talked about is that you don't have to check for each pixel
Read it again then
so for each 4 pixel group you load its corresponding nibble and then index it into a table of routines
that nibble corresponds to one graphics primitive such as lines, rectangles, and text?
for filled rectangles that seems like it would work fine (the routine should be simple) but what about arbitrary (i.e. not vertical/horizontal) lines, text, and generally other hollow shapes
you'd need to somehow cache the info used to draw that text
It corresponds to a set of pixels that should be drawn
You inline this in the routine
You would generate code for each font you load to do this for each character
so that nibble is a bit set?
what happens if you want one pixel to have one color and another pixel to have a different one, in the same group represented by that nibble
Give a more explicit example of a situation where you'd want this
YES THATS THE WHOLE IDEA
Then those are two different elements
or wait i swapped the coordinates
so you want to clear the buffer and fill it in for each element?
or somehow otherwise reuse that buffer
(im a bit tired so excuse me if im misunderstanding)
You'd initialize it using the clipping regions and use it to draw the parts of elements that overlap borders
it seems much faster to do a masked store than anything involving indirect jumps
Tbh, yeah
just have a mask bitmap with the same size as a AABB around the clipping region and do masked stores
or use tiles that split the clipping region into multiple parts
I don't have masked stores
that got me thinking
load pixs from 4 pixels of framebuffer (ideally you'd have a copy in RAM or fast MMIO to the fb)
load mask from keepmask[nybble]
pixs &= keepmask[nybble]
pixs |= colorsmask[nybble]
store pixs into the framebuffer
this could be easily doable on the framebuffer in xr/stations since it uses 8bpp iirc
so one 32 bit word corresponds to 4 pixels already
Btw I didn't get annoyed bc u were criticizing my idea I got annoyed bc u didn't understand it before u started confidently criticizing it lol
No
Reads from framebuffer are bad and im not wasting 768kb on an in memory copy
The whole point is that there are memory constraints
okay cool
768kb?
how big is your fb
oh wait its 1024x768
right
1024x768 @ 8bpp
If there weren't memory constraints I'd just do a compositor like every other hobby window system
so masked stores dont seem like theyd work in that fashion
that's probably the whole point of why you wanted to use indirect jumps
what is "like every other hobby window system"? I've probably seen one or two good designs of compositors and plenty of bad ones 
it's still slow as hell and I'd argue it might end up slower than a read mmio from the framebuffer
I actually think if you unrolled the outer loop it'd be pretty fast
unless read mmio isn't at all possible
you have to factor in the cost of the jump to your nybble table
why are you imposing these memory constraints?
1989 workstation larp i think
I've had 2mb for graphical boot as a goal for yrs
ah
Especially because again you only do this for border regions you could do simpler stuff for like pieces of a string of text that are fully exposed and whatnot
i want to do a stacking WM for boron as well but mostly because i didn't do it before
I want arbitrary clipping regions as well not just rectangles
Represented with spans in the higher level code maybe
Also this is on a per element driver basis, so if there was a better way for some particular thing then you could do that instead lol
if you have clipping regions that are much smaller than their AABB, a good strategy is splitting them into tiles
then you can arrange the tiles in memory such that the entire tile is prefetched when writing it out to the framebuffer
and you can write to the framebuffer in a linear fashion
which is advantageous when CPU store buffers are used
maybe he wants a round clock for example
you can split that into AABBs or express it in scanline spans or stuff like that
Do you have any resources on this kind of thing
I don't know much about raster graphics programming yet
I need to figure it out before I do my window system cuz I don't want it to suck
I am going to kill you for criticizing smth without understanding it first and then speaking for me that's like my two biggest pet peeves in the world
Prepare to die..
😭
my goal wasn't really to criticize tbh
i just wanted to see the full picture because the incomplete picture misled me into useless concerns
lol how is this criticizing
if i understand this correctly, this means that you are generating 16 versions of each draw routine with any combination of pixels set
This isn't criticizing?
to avoid reading from the framebuffer
yeah this is how i'd understand it
i said seems
because the picture was incomplete in my view
That's criticizing and it turned out you didn't know what I was talking about, and this is an annoying way to prompt for clarification versus just asking for clarification
Yeah
so for the worst case 0b1010
you're writing a byte, skipping one, then reading another
since you do not know what's in the 0 bytes and you do not wanna overwrite it
but wouldn't this in hardware, either generate a bus transaction for each byte if uncached, or a RMW if cached (kinda defeating the point)
You can do byte stores
And bc goofy 89 mips workstation style caching setup, cached mappings are all essentially write-combine. On a later system you'd have that as an explicit setting
but that's how it is there and so that's how the framebuffer is mapped essentially
if you have a 32bit bus you're using a quarter of it (in this worst case scenario), which isn't terribly bad
since you have no burst transfers etc
but i think ram burst transfers were a thing in 1989 already
Welllll not exactly
You're right that there's an rmw here
It wouldn't be too difficult to add a real write combine mode
Or assume reads from the fb on cache misses won't be that bad which may be the case in 89 ish
i was thinking to avoid memory messes by always recomputing everything in that padded region, so you can do 32bit writes without issues
but looking up what is below might be expensive
It would be actually bc I was thinking of allocating a cache line without reading into it so you can just modify data and then let it get pushed out to the framebuffer, but the way the cache sim is rn it only writes out full cache lines so you'd corrupt the surrounding bytes
Would be annoying to make it capable of writing individual bytes
And also unrealistic
The mips workstation I yoinked the cache design from certainly couldn't do that
from what i know you couldn't eliminate the rmw entirely
since at the very least the memory controller has to read the row, modify it. and write it back
if you write continuously it's amortized as the rows are 256 bit or greater
could you add a special "zero cache line" instruction? it's not hard at a hardware level
so it would not be that out of place
That doesn't help cuz now you're writing black pixels out randomly
ah yeah i guess that would only help if you had a compositor
something like _mm_prefetch and _mm_cflush?
although prefetch does read the memory so maybe not
partial cache flushes sound quite annoying
I picked this up from a haul in July 2020 and finally powered it up. Apparently, i860 workstations aren't at all common. I got truly lucky, and got the hard drive to spin up on the third try (I think it either had dried lubricant in the bearings or maybe stiction). In either case, I was able to...
disk image dump for unix system v/860
lol
whatever that trade secret information was has probably become wide & trivial knowledge by now
thats not even enforcable afaik
lol
they could, maybe, say that IF you use their software THEN you must not share their trade secrets
since trade secrets aren't copyrightable
typical unix inferiority!
a fixed size swap partition that takes up 25% of the disk space
smh
fixed size swap is more efficient tho
unless you can allocate contignous disk sectors
says who
which i dont think fses could at the time
ah fair
though not guaranteed
cut it in half until u find one and then u can get maximally contiguous extensions
still less efficient than add + dispatch disk read
doesnt linux still do a fixed swap partition typically
you can have a swap file
macos and windows both do a file by default
mach has always had a file
traditionally at /private/vm/swapfile i think
interesting
but idk where it is in modern macos
probably in /System and behind TCC
ah /private/var/vm
thats not even that different from mach
ah no its in /System/Volumes/VM now
$ ls -l /System/Volumes/VM
total 10487808
-rw------- 1 root wheel 1048576 Feb 11 05:49 kernelcore
-rw------- 1 root wheel 1073741824 Feb 12 03:38 swapfile0
-rw------- 1 root wheel 1073741824 Feb 19 13:55 swapfile1
-rw------- 1 root wheel 1073741824 Feb 21 02:50 swapfile2
-rw------- 1 root wheel 1073741824 Feb 14 00:56 swapfile3
-rw------- 1 root wheel 1073741824 Feb 23 09:52 swapfile4
on my mac
i think most will do swap partitions
though i have stopped using swap after upgrading to 32 gigs
that is part of their swapfile resize scheme
why is it 1 meg
instead of resizing a single swpafile, they make N swapfiles
very suspicious
allocating more as needed
svr4 or earlier?
make a copy and send it to me so i can take a look 
that one, yeah
its svr4
grep suggests it's defined as the kIOCoreDumpPath
mark lucovksy told me they (the NT team) were in close contact with the guys doing the svr4 port to the i860 at intel
and they shared fixes for weird chip bugs
early on in the process for both of them
in '89
i think he also mentioned they had a diff philosophy toward the chip bugs that he disliked
E.g., imagine interlocked operations having some edge condition quirks… So OS level code using these instructions would have to run a certain way, to avoid quirks — e.g., operation only works if operands 1 and 2 have identical address bits in position 24 and 28. Dave would tell them to fix their shitty CPU. An Intel Unix porting engineer might just ignore it, or panic if they see this, or work around it.
Dave would make some compromises, but not many, and definitely not to appease Intel
this was before he got in too much of a politicsposting trance to answer my dms :(
it's read in IOBSDMountChange when op=kIOMountChangeMount or kIOMountChangeDidResize, and corefile_open_call is called if that's the mount that changed ig. that calls IOOpenPolledCoreFile, which does a whole bunch of stuff
presumably to make sure it can write the kernel crashdump
"operation only works if operands 1 and 2 have identical address bits in position 24 and 28"
what the fuck
he probably made that up based on a vague recollection of an actual i860 chip bug
probably in the cache management stuff
fine, i stopped using the splint after like day 2 bc it stopped hurting lol
range of motion is still bad and feels weird/painful if i fully extend or contract my arm
the splint is there for more than pain management 
you dont want your bone to heal at an angle
its probably fine for this specific type of break
happy to hear that
its a crack in the bulby part on the end of my radius
that goes into my elbow
theres no misaligned/angular healing potential there
i might be overcautious about these things i suppose
good that its hurting less though
so i dont think i need the splint and the range of motion problems are probably from overextended tendons that are still healing or something
i fell flat on my ass last month and managed to fuck up every tendon in my left arm lmao
that was how i broke my elbow
didnt have full range of motion for 2 weeks, although that was a sprain not a break
i slipped on ice while taking out the trash at like 3am
oof
why does it get closer to 12 am each time you mention it
when i was 14 i had to take the bins out when it was icy and managed to end up squashed under a trash can
LOL
spent like 3 minutes feeling sorry for myself before a neighbor saw me and pulled the bin off me 
damn
where i lived previously had stairs in front of the apartment and i would keep slipping and falling there
it wasnt particularly heavy but having the wind knocked out of you + it being really slippery meant i was stuck lol
oh yeah icy stairs are the worst
luckily i was still a child back then so i didnt break anything
someone walked by shortly after i recovered and stood back up and was looking at me and im p sure he didnt see me fall but he may have heard my involuntary pain yell
which was like AHHHhghhhh fuuuckk
yeah, one day at like 6 am i fell before getting on the school bus and ripped my pants
spent the whole day like that
so many people have seen me manage to fall on flat ground / randomly fuck up while going up stairs i rarely get embarrassed anymore
i fell down the stairs in my familys house last year and i made the same noise and nobody came to help and it was because they thought i was playing with the cat because i make weird noises while i play with the cat
i fell down a flight of stairs at my junior school and took out like 6 children by accident
it was a very long flight of stairs
your wording makes it sound like they died
thankfully everyone was mostly fine
ig i did get embarrassed while going up stairs today but it wasnt by accident :(
It's for debugging using the kernel debugging protocol
i cant play with my cat for longer than 3 mins, he goes into sicko mode and starts trying to kill me
this somehow only raised more questions
¯_(ツ)_/¯
i made a copy and opened it in a hex editor and its just a bunch of newline bytes and zeroes
look at that lonely newline
10/10
it is literally a ten
@acoustic sparrow i still wont send it to you in case the spacing of the newlines encodes my social security number or something
steganosaurus
or whatever u call it
yeah i looked into it
how many digits are SSNs
no its for saving coredumps when the os crashes
afaict
or at least stacktraces
which are then useful for...
sending to apple
who uses them to...
this reminds me of that moment in breaking bad where walter white's like
"which element does this?"
and jesse is like
read?
"aaah wire"
i stopped drinking aspartame a few days ago and i feel great
i also stopped hitting myself in the head with a mallet 15 times after waking up
but i think it was the aspartame
wym? the system can be configured to generate a kd dump and then you can inspect it
Feels like we're talking about different things?
ah yeah that makes sense
that's not strictly speaking KDP though? afaict
not necessarily, a kernel dump is obviously about the kernel, but crash dumps can also be collected for apps when they crash
ah, yeah
is that also part of this component of the kernel coredump mechanism?
didn't get the question, but this thing is spread across different components
yeah makes sense
must've been damn painful, get better soon
thanks lol
it stopped hurting weirdly quickly but yeah it was pretty painful the first like 2 days
is there a reason for that
its probably easier to implement
hmmm makes sense i guess
btw im kind of surprised you didn't know that since its kind of your favorite topic, you didn't dig into the design of the system you're using every day, why so?
does the swapfile need to have a name in the filesystem? I don't understand why it wouldn't make sense for it to be opened as an O_TMPFILE or equivalent
idk if the particular name and path to a swapfile is my favorite topic
probably cant name that about modern NT either
i can tell you it was at /mintia/pagefile.sys on old mintia though
probably bc otherwise every time you hard rebooted youd have to clean up the orphaned blocks left behind from the nameless swapfile that wasnt properly closed on shutdown
i didn't mean the file name lol
this particular detail might have changed in the past so it's understandable not to know for sure
iirc on non desktop targets the path might be different
why have one swapfile, actaully? is there any advantage of that?
is there a disadvantage?
yes, its more code
in place swapfile resizing is more code than just making more swapfiles, assuming you handle multiple swapfiles already
idk if thats necessarly a disadvantage
kinda is
with one large file it might be harder to find a contiguous region ?
how does having multiple files fix fragmentation
thats not the same thing
vulkan is more code because it lets you do more
and having 3 swapfiles of 1 gig each vs one swapfile of 3 gigs is the same thing
i was thinking of creating a new file if you need a contiguous region
does a swap contignous region matter?
dont think so
contiguous large regions will be faster to load app working set
i think windows has a separate page file for swapping entire app working sets
would they be faster
maybe on hdds it's more important?
on nvme, the only thing is you submit less commands
on hdds yeah it matters more
swap on hdd is a lot worse
like in general
ig on ssd is faster too, just not as noticeable?
on nvme, no
actually hmm
sequential reads
maybe you can submit less commands
sequential reads arent much faster aiui
so long as you read in multiples of a page
it doesnt matter at all afaict
U could make more
yeah but like. is there any reason why one swapfile + resizing is better than mulitple nonresizable swapfiles
Because it's easier to shrink
is it?
sounds like the same procedure
evict pages in the to-be-deleted swapfile
then remove
same way that shrinking works
force them to be faulted back in
and do not allow pages to reenter it
actually you (or at least me, NT, and VMS) dont do that lol
wait so how do they shrink page files?
just, if you rng to get lucky?
that sounds like a bad approach
or else how do you shrink a swapfile?
its like a little higher than chance that if the commit usage dropped significantly below the commit limit, the top part of the pagefile will be unused again and you can chop it off
eh
not necessarily
anecdotally from mintia experiments it works decently
let's say theres a broken program which does while (true) allocate page()
OS/2 would actually do what youre talking about though - actually it would go even further and would defragment the pagefile in-place and other weird shit
until it crashes
then if you allocate a page but not use it
that moves the minimum shrink size up
ah, that's more like what i'd expect lol
i feel like "we have no guarantees that this portion of the pagefile isn't used, but let's discard it anyway and hope we're not dropping a bunch of information"
isn't a very good strategy
thats not what i said though
no they only chop off once theres nothing there
you check to make sure its unused before you do that lol
imo cleaner to actively clean it
then fuck you ig
or this
the primary issue is that youd need a back-map from pagefile slots to their users
and then thats more wired information sitting around
u understand thats obscenely slow right
its called background task lol
even at like a 15 second interval
i mean the locking for that would be crazy and would hold people up left and right
if they yieleded its probably because they are waiting on io anyway
:^)
also, lets say you have 1 gig of ram, and you want to sweep it all in 15 seconds, that's 18k pages per seconds (ish). thats not like, a lot
especially since the critical path is just checking if a page belongs to a swapfile above the watermark
ur welcome to make this work well in mintia2 once the new vmm is done
id love to receive that PR
then i can put on my resume that i managed a crowdsourced project
only rule is ur not allowed to use a global lock
anywhere
okay thats fine ill have 16 global locks

(and then address % 16 because thats definitely how you break up a global lock)
that works sometimes!
i have two of those in my new Ke
arrays of spinlocks indexed by hash of address
yeah I was gonna say just using the address itself as hash is a bad idea
yeah that makes sense
i do almost the exact same thing
i say almost bc my mutexes are 4 bytes (a pointer size)
(they have an externally allocated hashtable for dynamic bookkeeping)
and one of the arrays of spinlocks is for this
the other one is for guarding the existence of balanced work queues
okay so anyway going back to it
therers probably even cheaper ways to do it than that
like abusing rcu or something
i dont have rcu cuz i dont know of any satisfactory way to do it (bc i havent looked, not bc it doesnt exist)
ah
keyronex's way wouldnt work for me
have you heard of my rcu impl meme strat?
i have not
which allows for partial rcu without blocking scheduling
you implement read pointer and increase refcount in asm
then if you interrupt inside of that
you software emulate the instruction that bumps the refcount
and then make sure that every cpu isnt in the critical section before freeing (which isnt super hard to do, either by spamming out ipis, or some clock stuff or whatever)
i wouldnt have much use for an rcu that requires accesses with elevated ipl, because then i wont be able to put gargantuan amounts of things in paged pool
i like this kind of trick
yeah thats the cool thing about rcu meme edition, it doesn't care!
you just restart the rcu section
paging safe!
please dont actually implement this
i think your way is bad because you basically guarantee unbounded numbers of pending frees whenever the system is even vaguely busy
you can make a free block until the free completes as well
is it unbounded tho
it's only unbounded if one cpu dies
hmm actually no its hard unbounded
never question my intuition
im incapable of rigorously proving anything but my intuition is infallible...
really
im the pinnacle of engineer type who cant do any math, except better bc i recognize that that does mean im stupid
it's funny I've been edging finishing Ps for like 3 months now
if I had late 2021 energy levels I'd have gotten it done and moved on in literally two days
I'm so nerfed now
My energy levels have been through the floor for like a year and a half
I do like
3 hours of work and im like "okay that's enough for the next two weeks"
It's not burn out on the project it's just depression in general
have you tried forcing yourself to work on it
"Fuck it we ball"
Idk take a break, do something totally unrelated for a few days at least
force someone else to force you to do it
Play fortnite for 14 hours a day
Message schizophrenics on discord with random number sequences
buy 2 more screens
one of them is going to have subway surfers
the other one is going to have fortnite gameplay
and the main one will be the one where you work on MINTIA
I will suddenly work for a week straight and write 10k lines of code in a month
Do something totally unrelated for 10 years
me too
u can visually see the diff between risc and cisc instruction encoding looking at mintia kernel binary in a hex editor
u can see the 4 byte aligned instructions of the xrstation build (top) and the not-aligned not-4-byte instructions of the fox32 build (bottom)
oh thats really cool
i have a fantasy that ill fix a subtle bug and then the next day i get an email saying "omg we were waiting to see if you would find and fix that incredibly subtle bug! youve passed our test we want to give you a $300k/yr senior position on our kernel team! when can you start!"
applying to kernel or systems programming positions is a more realistic path towards that goal 
yes this is definitely how recruiters work
back in 2021 when the SE job market was crazy recruiters definitely scanned github
but that "we saw that you contributed to project X, don't you want to join FAANG company Y" spam definitely decreased
yeah ofc
but that's slightly different
yea ofc they didn't monitor individual bugs
yeah
i have a fantasy that the windows nt memory manager will magically click in my brain and i'll be able to recreate it and bang it out in a week in boron
but it's not happening unless i put in the effort
even after i understood it it still took me like a year of tinkering to end up with something with like the core 30% of the functionality lol
largely bc i had never implemented a fancy vmm before
not a good sign for me
I suppose I should just sacrifice quality for now so that I can move on?
and then improve later?
my first attempt, i started, got spooked by the big change in the concepts, and reverted to what i knew - though i think i had already imported the NT style reference count and MDLs, which after deploying simply felt like a much more sensible way to do things than the quite complex approaches some systems use, with awful per-page "this page is being written back" locks and a general lack of clarity compared to the refcnt concept
later that year i started building one again, then i threw out half of it and started testing the whole thing in userland simulation
An underappreciated reason that the DEC alpha kicked ass wasn't just microarchitectural superiority but like
They laid it out by hand, it was the last major cpu to be laid out by hand
Aside from particular important pieces and the high level overall layout that's literally impossible to do now because of the complexity of modern chips
we now have computerized ai hands that can do the equivalent of placing every transistor by hand though
since somewhat recently
looks like something out of the powder toy
would you believe me if i said this is the first 'segfault' ive gotten in like 2 months
yes cuz i also havent had segfaults in a long time
after a certain time you just grow unable to write simple memory bugs that result in segfaults
ok:
Ps (process management) is done
new mintia:
608 ./PsGroup.jkl
1791 ./PsProcess.jkl
371 ./PsInit.jkl
1187 ./PsThread.jkl
788 ./PsJob.jkl
4745 total
old mintia:
704 ./PsProcess.df
569 ./PsInit.df
428 ./PsOSCalls.df
797 ./PsJob.df
840 ./PsCreate.df
141 ./PsUserEntry.df
251 ./PsThread.df
375 ./PsDelete.df
4105 total
ppl who said old mintia was only that many lines of code bc dragonfruit wasnt dense enough are in SHAMBLES rn
boom
next up is IO system
ill be at base level 3 after io manager is done, and then ill be working on base level 4 (which is all the hardware drivers)
this is basically a topological sort by dependency of all the kernel subsystems
ive been following this plan unmodified for like 9 months
i embarked on the rewrite uhh
2 years ago
and ive written about 80000 lines of code in service of that
I WILL SHOW YOU ALL HOW TO WRITE AN IO SYSTEM
RAAAAAAAAAAAA
*writes 100 lines of code a week
no i think things will heat up now that its doing something interesting (inputting and outputting)
very first thing ill be doing in the IO system is IO packets
which will be almost identical to how they were implemented in old mintia probably
Just out of curiousity, what order have you made things in the kernel so far in this version?
See this
oh
Maybe I should have just read up a little bit
do you intend on doing an x86 port (32 and/or 64) at some point?
yes an amd64 port will happen after all this is done
ok
this is imo the Correct Order
any variation on this order leads only to pain
that is to say
- exception handling & spinlocks
- scheduler
- blocking mutexes
- pmm
- heap
- drivers
- vmm
So, at what point does multiprocessor support exist?
and how does the heap work if it is before the VMM?
multiprocessor support is like
before #1
its #0 which is architectural initialization minutia that isnt worth mentioning
why does it need a vmm
wouldn't it be using virtual memory?
yes
but if youre on 64 bit you probably have some big hhdm like limine gives you
you can just Use That
even if you dont, page table management is not the same thing as virtual memory management
I know that
I think I understand
On 32-bit, physical memory and virtual memory aren't that different
personally i dont (bc im on a 32 bit target rn) and i just have the bootloader pre-populate the page tables for certain regions of system space
and then in the memory manager i just Assume that those PTEs exist and that i can directly use them to map stuff
this is one of the tricks the deep state doesnt want you to know about
and has banned me several times for spreading
bad tricks 
It's good trick
going to suddenly dump a 10k line commit that implements the entire io system
io packet management is going quickly because im largely able to just rewrite directly from old mintia (some of the first code where ive been able to actually do that)
i havent had any groundbreaking developments since then so its mostly applicable to the new design
streams is the only new thing here and that will be fully encapsulated by the existing packet structure
a streams request will just be a single-level io packet targeted at a streams wrapper driver
that works as an adaptor between the data flow driven streams stacks and the request driven higher level IO structure
Is there still a mintia discord server?
yes but its in an inactive phase rn
probably until the next time i get banned from here
Can I get an invite to that server? (obviously in a DM, not here)
example of a track i can listen to on repeat until my brain goes numb enough to just work on stuff for 8 hours straight
my example: https://youtu.be/0etenwnI1wo ("scattered and lost" from celeste)
especially that last part
video game OSTs dont count as music
except the sonic R soundtrack since thats the one i like a few songs off of
but i never played the game theyre from so its fine
look how much of a level-up jackal is
some packet routines in dragonfruit:
same in jackal:
looks almost like a real kernel now!
old mintia feels like the VMS to this guy's NT or something
weird crummy ancient uniprocessor thing polished to shit
rare will L
lmao will wtf
WOKE is cancelling me for my opinons
404
this colorful theme is making it way funner to work on mintia2.
it satisfies my monkey brain being upset at no cool flashing colrs on the screen.
lyric? love her
idk i think it's fake music
i think you got tricked into listening to unreal music
unreal music, you say?
https://www.youtube.com/watch?v=8Hn-pNxtByM
Music from Unreal Tournament (1999) featuring most of the signature tracks.
Tracklist:
0:00 Skyward Fire (Michiel van den Bos)
4:55 Nether Animal (Michiel van den Bos)
9:52 Foregone Destruction (Michiel van den Bos)
14:06 BOTPACK N°9 (Michiel van den Bos)
18:29 Mechanism Eight (Andrew Gregory Sega)
24:53 The Course (Michiel van den Bos)
Soundc...
Celeste, holy fucking bingle !!!
@warm pine i am considering doing the any-context part of IO packet completion from worker thread context
all my pmm locks and stuff are blocking mutexes so i can no longer do it directly from the DPC
bc that part needs to quickly unlock memory and stuff
so youd call IoCompletePacketFromDpc and this will enqueue a worker item which calls IoCompletePacket which does the any-context part and then, if relevant, enqueues an APC to the requesting thread
i could do the whole thing from the APC context always
but then i dont get prompt response for unlocking memory and doing the completion callbacks and stuff
unless i unconditionally did a really big priority boost to the requesting thread while it executes that APC
i think that's the common sense way to go about it
your smp approach is similarly styled to what was intended (and implemented with compromises) for solaris
where they wanted to upgrade interrupts where possible to threads in such a way as keeps the logic of the interrupting (and they optimised this with tricks like acquiring full thread context only if the handler has to block)
oh yeah
it goes the same for the i/o completion dpc
i'd be perceiving this as a case of interrupt threading
you just made me remember that Most of the interrupt work for most of my drivers was gonna be in worker thread context anyway (because of all the locks being blocking mutexes), so i can just directly call IoCompletePacket most of the time
like, ill have already eaten the cost of dispatching to a worker thread
IoCompletePacketFromDpc would be like a helper
packets r done
next up i will do xrstation disk driver to flesh out device objects and stuff
and then ill do mintia2's first IO request
4 years after old mintia's first io request
:(
this thing has been in development almost as long as NT 3.1 was
but does way less because im just 1 stupid gay idiot
i sure have learned a lot though
also im really hyped about how much better mintia2 is than mintia1 in every conceivable way
my Extremely Ambitious Plan is panning out well so far
p much everything that bothered me in old mintia is fixed this time around
so far
but its still only like idk 25% done
youd think itd be disheartening to see this line count and still only be able to go "yeah its idk 25% done"
but its not cuz ik ill get there
itll take like a year but i will
in mintia2 im building the platform-specific stuff into the kernel binary
so the HAL and the "platform driver", which in old mintia was all the integral components of the platform (so stuff thatd be soldered on the mobo) linked together to save some space thatd otherwise be wasted by executable headers for the extra modules
i am calling the platform driver the ISD for "integral system driver" this time and its also getting linked into the kernel binary
i have no separate HAL binary cuz that was pointless larp last time, and if im linking that into the kernel then the platform driver should go in there too
well, that's cool
test crash halfway thru the fireworks test thread drawing its background
from another cpu no less
why was it "pointless larp"
isnt all larp just for entertainment
the point of the HAL was to put the platform-specific stuff in a separate binary, so that people porting NT to new platforms could do so without needing source code access
two reasons this makes no sense for me to adopt and made no sense in old mintia:
- its open source anyway
- even in practice in NT theyd just give people full kernel source access, and they ended up regretting the HAL eventually
platform-specific is not to be confused with architecture-specific
arch-specific code was always compiled directly into the kernel binary
so like they supported the MIPS architecture, and the MIPS arch-specific stuff was just compiled into the kernel
but they supported like 10 different MIPS platforms (various attempts at workstations and PCs) and they each had their own HAL
this is a third reason it made no sense for me to adopt: there's a one-to-one correspondence between architecture and platform for all three of my intended targets anyway
fox32, xr17032, and amd64 each dont really exist outside of a particular platform
@twilit smelt i may have found a bug in the fireworks test again
see this
i believe that's supposed to break out of the loop, not entirely exit the function
so in OoM situations you might end up crashing in an explodeable thread
(unless you made threads automatically exit when returning from their entry point)
i did not make them do that
so it's a bug
well yeah it's my bug sorry
btw i still have a hal internally and it is conceptually separate from the arch-specific code
but its all linked together
this time
the ISD and HAL are going into the same source directory
but r logically separate components
the HAL is logically part of Ke and the ISD is a driver
i see
NO!!!!! BACKTALKING!!!!!!!!!!!!