klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
<klange> I regret not having a PonyOS 3.11 back in the day...
<heat> adopt a windows naming convention and go back
<klange> we'll just wait for toaru to get up there
<zid> what killer features does a workgroup need
<zid> cut 3.11 when those are ready
<kazinsal> geist: yeah, I've had some bad luck with vintage computers being shipped. pretty sure next time I get one I'm just going to find one on seattle craigslist and make a weekend road trip of it
<geist> that's basically what i'm doing. got my last mac and apple 2 from craigslist and have been just keeping an eye out
<geist> though really i dont have much i'm looking for that i dont already have one of. probably a reasonably priced amiga will be my next buy
<kazinsal> yeah, I think all I really "need" at this point is an 8088 PC of some sort and an amiga. maybe one of those very specific models of macintosh that can run A/UX for a lark
<geist> yah a SE/30 would be nice, but they're rare and well sought
<kazinsal> yep
<geist> the later mac IIs and whatnot i'm just not into really
<geist> plus they're apparently terrible w/bad caps
kazinsal has quit [Quit: Updating details, brb]
<geist> but a proper machine with an 030 or 040 would be nice. i used to have a next slab, but i sold it off before i moved
kazinsal has joined #osdev
<geist> dont really regret it, but kinda wish i still had it from time to time
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<geist> but it was a pain to drag around with the screen and whatnot
<geist> can't just use some LCD on it like a lot of older machines
<kazinsal> yeah, the specific connector and electrical connection they need is a pain
<geist> and keyboard and mouse. it was 100% bespoke
<kazinsal> very jobsian
<geist> but i found someoine that i think was going to really appreciate it and not just flip it on ebay
<geist> so i didn't feel bad about handing it off
<zid> when is my #osdev supplied sgi onyx arriving?
<geist> hmm, those might be a pain. lemme see whats in em
<geist> ah onyx 1 was R4400s those are straightforward so i hear
smach has joined #osdev
<kazinsal> for twenty years in #osdev you get a free cray
<zid> geist disappears behind a door marked "staff only", to the #osdev storehouse to check what's in stock
<geist> onyx2 is a R10k or so which i think are okay?
<zid> "Best I can do is a packard bell with a fried bios chip"
<geist> it was the 8000 that i hear was a disaster
<kazinsal> "two newtons and a modified game boy link cable, take it or leave it"
<zid> "if you upgrade to the platinum membership you can get a free mouse"
<zid> kazinsal: I have a gba link cable spliced into a printer cable in my drawer
<heat> i want the prototype mobo that supported itanium and ia32 at the same time
<gog> hi
<zid> no
<zid> gog I bet it's dark af in iceland rn?
<zid> solstice + treeless latitude
<gog> breh it's sunny and bright here
<zid> ah right you live in magic-island
<zid> I was trhinking of cod-iceland
<gog> easy mistake
<zid> I wonder if they do mail exchanges like slovakia and slovenia do
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
<gog> probably
<geist> the pyroclastic lava flow keeps the town well lit
<gog> yes
<zid> who are you calling pyroclastic!?
<gog> they call me mrs. pyroclastic, very fantastic
<heat> gog give me the prototype mobo
<heat> please
<gog> ok
<gog> what color you want it in
<heat> red because im a gamer
<gog> gamer red
<zid> purple solder mask is the one true colour
<kazinsal> mountain dew code red pcb colour
sortie has quit [Quit: Leaving]
<geist> interesting that `nvme list` shows what the device reports as space in use
<geist> at least the samsung ones return an accurate number. you can actually watch it go down as you trim it
<geist> also interesting that you can actually watch the device run background tasks since it seems to for a minute or so after you complete trimming it the counter keeps going down
<zid> I wasn't sure what to get you, so it's a goblin siege
Burgundy has quit [Ping timeout: 265 seconds]
<klange> kazinsal: i would totally take a newton, fig or apple
rwxr-xr-x has joined #osdev
<rwxr-xr-x> Got a text wall here I need help with regarding buggy conversion of code https://gist.github.com/FrostWizard4/79fc35b2996c1fba1c0422b19bf31f47
<bslsk05> ​gist.github.com: Info.md · GitHub
<rwxr-xr-x> Anyone who can help out will be appreciated!
<zid> never heard of intel v
<zid> why not look at the diassembly
<rwxr-xr-x> Intel *System* V ABI, my bad
<zid> "System V Application Binary Interface"
<zid> Nothing to do with intel
<klange> It's not "Intel" anything, System V refers to the UNIX release.
<rwxr-xr-x> Also, great idea, I forgot I had Disassembly lol
<heat> AT&T SYSTEM V
<heat> the True Unix
<rwxr-xr-x> God damnit heat
<rwxr-xr-x> I knew I would hear that shit
<klange> That's more accurate, but the whole point was that there were many System V versions :)
<heat> what shit
<rwxr-xr-x> AT&T shit
<zid> less ADHD more disassembly
<heat> no
<rwxr-xr-x> spit on that disgusting syntax
<heat> wtf
<klange> It has nothing to do with assembly syntax.
<zid> SCO syntax for life
<kazinsal> xenix syntax or gtfo
<rwxr-xr-x> POC || GTFO
<zid> I don't know any other unix distributators
<rwxr-xr-x> Write the best syntax
<rwxr-xr-x> Combining all of them
<kazinsal> there were a lot in the 80s
<zid> yea I am too young
<klange> zid: HP still distributes HP UX
<zid> oh yea heard of that one
<klange> And macOS continues to get certifications, so Apple should count.
<zid> HP syntax would charge you $8 per character presumably
<heat> IBM AIX
<zid> in ink refills
<heat> Solaris/SunOS
<kazinsal> there were enough Unixes that at the end of the 80s AT&T had to set up a special business unit just to figure out how to help them all standardize
<zid> don't ket kai***uchi know I made a packard joke, he'll send his hewlett after me
<heat> HP sold itanium
<heat> don't make fun of HP.
<zid> HP special ordered my favourite cpu as an OEM part
<kaichiuchi> zid: i'm here
<zid> THe itan^W xeon e5-1620
<kazinsal> there's still a supported, recently updated SVR3 system distribution. SysV will never die
<heat> which one?
<kazinsal> OpenServer 5
<heat> oh lol
<zid> gog: https://i.redd.it/tfol0f5ojb7a1.jpg Christmas gangwars have started, down with iceland!
<kazinsal> first release was 1995, most recent release is 2018
<heat> horrific
<kazinsal> 23 years of releases for the same SVR3 system!
<heat> who tf works on that kind of stuff?
<kazinsal> people with giant legacy contracts
<heat> can I get one
<heat> i know how to write a mean UNIX(r)
<kazinsal> in various sectors there is definitely what my friends would casually refer to as "some serious shit in the meat"
<zid> https://i.redd.it/ry91u4i61d7a1.jpg Rumor is it they're in a turf war with this guy
<kazinsal> man just wanted some greggs sasuage rolls
<zid> You'll have to drive-by the lidl sweater people first
<zid> gang initiation
<kazinsal> gonna look on ebay for a vintage zellers christmas sweater
<kazinsal> god damn I miss the hot chicken sandwich
<klange> zid: did they try checking the local greggs?
<zid> I need a happy shopper sweater
<zid> https://www.ebay.co.uk/itm/255885479571 To go with my sweet mug
<bslsk05> ​www.ebay.co.uk: Vintage Retro Novelty Happy Shopper Mug With Feet | eBay
<heat> hidden long __cancel(), __syscall_cp_asm(), __syscall_cp_c();
<zid> hidden long __cancel(), crouching tiger();
<heat> duuuuuuuuuuuuuude musl actually takes advantage of ()
<zid> what's that supposed to do?
<heat> error: too many arguments to function call, expected 0, have 8
<heat> when compiled with std=c2x
<zid> oh are those extern function decs?
<heat> yeah
<zid> STATIC VOID f(VOID); is the only true dec
<zid> all others are bad
<zid> params and return values are just fancy globals
<heat> STATIC VOID Foo (VOID);
<moon-child> ok tbf it was really fucking stupid of them to change that in c2x
<moon-child> for function definitions, totally legit
<moon-child> but for declarations/ptrs, the excuse was you can use ... instead, but the calling convention is actually different for that on some platforms
<zid> Like say, x86
<zid> that garbage platform nobody uses
<klange> def f() -> None:
<zid> Glad I don't have to put x86 edge case code into all my projects, that'd be a nightmare
<zid> I only write for normal cpus, the pdp-11
<epony> don't fake it, you just write JS
[itchyjunk] has quit [Ping timeout: 246 seconds]
<epony> (jasus'crypt)
[itchyjunk] has joined #osdev
<heat> moon-child, how is () useful?
wootehfoot has quit [Read error: Connection reset by peer]
<rwxr-xr-x> Using ndisasm on the file is adding confusion lol
<rwxr-xr-x> Actually, hold that thought
<rwxr-xr-x> I think i'm being dumb
<moon-child> heat: for dispatch-y stuff where you don't wanna cast the function pointer or use a union
<moon-child> e.g. we use it in the j interpreter for sorting routines specialised for different data types, as there is some higher-level dispatch wrapping that
smach has quit [Ping timeout: 268 seconds]
<klange> i should write another language
<rwxr-xr-x> sounds fun, i was going to, but settled on an os
<klange> i did both
<zid> make your compiler run bare metal, write everything in source lang
<zid> simples
heat has quit [Remote host closed the connection]
<klange> That is actually what I have in mind for another language project, a fully compiled one instead of a bytecode VM.
heat has joined #osdev
rwxr-xr-x has quit [Remote host closed the connection]
<heat> moon-child, solution, cast
<heat> having loosey goosey functions and function pointers is dangerous (and it's dangerous to have those by default too)
Vercas6 has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas6 is now known as Vercas
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<moon-child> casting is annoying tho
Imk0tter has joined #osdev
Vercas8 has joined #osdev
Vercas has quit [Ping timeout: 255 seconds]
Vercas8 is now known as Vercas
_73 has quit [Remote host closed the connection]
gildasio has quit [Ping timeout: 255 seconds]
heat has quit [Ping timeout: 256 seconds]
Vercas has quit [Quit: buh bye]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
[itchyjunk] has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
gildasio has joined #osdev
tiggster has joined #osdev
simpl_e has quit [Ping timeout: 264 seconds]
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
tiggster has quit [Read error: Connection reset by peer]
bgs has joined #osdev
sdfgsdfg has joined #osdev
bgs has quit [Remote host closed the connection]
gxt__ is now known as gxt
sympt has joined #osdev
Ermine has quit [Quit: Cya!]
Ermine has joined #osdev
SGautam has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eroux has quit [Ping timeout: 272 seconds]
eroux has joined #osdev
eroux has quit [Quit: Textual IRC Client: www.textualapp.com]
gildasio has quit [Ping timeout: 255 seconds]
eroux has joined #osdev
gildasio has joined #osdev
vdamewood has joined #osdev
gog has quit [Ping timeout: 272 seconds]
Brnocrist has quit [Ping timeout: 260 seconds]
GeDaMo has joined #osdev
gog has joined #osdev
bauen1 has quit [Ping timeout: 272 seconds]
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
MiningMarsh has joined #osdev
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
bauen1 has joined #osdev
bnchs has quit [Read error: Connection reset by peer]
Left_Turn has joined #osdev
demindiro has joined #osdev
<demindiro> When unlink() is called inbetween readdir() calls the latter may start missing or returning the same entries twice right?
<demindiro> Context: bonnie++ calls unlink() between readdir() calls and it doesn't work well with my filesystem which uses hashmaps and resizes those whenever deemed appropriate
<demindiro> And sources I find online imply that you're not supposed to use readdir() after unlink() but manpage doesn't seem to be explicit about it
<demindiro> (ditto for create() or whatever)
<zid> the libc should be caching an entire `dirp` that readdir returns chunks of, as far as I know
<zid> but I'm not really a posix pooface
<demindiro> I don't think libc caches an entire directory though? They can be pretty big (mine supports up to 4 billion entries per dir)
<mjg> should a different proc readdir on over there
<mjg> what is going to happen?
<mjg> readdir the same dir
<zid> the trick is to notice that opendir has all the -E return codes and readdir cannot fail, imo :P
chdla has joined #osdev
bauen1 has quit [Ping timeout: 265 seconds]
wereii has quit [Quit: ZNC - https://znc.in]
spikeheron has quit [Quit: WeeChat 3.7]
wereii has joined #osdev
<bslsk05> ​pubs.opengroup.org: readdir
<demindiro> > If a file is removed from or added to the directory after the most recent call to opendir() or rewinddir(), whether a subsequent call to readdir_r() returns an entry for that file is unspecified.
<demindiro> But nothing about other files
<zid> okay so you can just do whatever, but you're not allowed to fail while you do it
<demindiro> I'll just look at what coreutils rm does I guess
bauen1 has joined #osdev
xvmt has quit [Remote host closed the connection]
zid has quit [Remote host closed the connection]
zid has joined #osdev
Burgundy has joined #osdev
<demindiro> So rm -r (with strace) first calls getdents64() a bunch of times until it finds no more entries, then newfstatat, faccessat, unlinkat for each entry
xvmt has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
spikeheron has joined #osdev
lg has quit [Remote host closed the connection]
<mjg> this can't be true for big enough(tm) directories
<mjg> well it can but it sounds like a bad idea
<mjg> you should check sources for a limit
Burgundy has quit [Ping timeout: 260 seconds]
demindiro has quit [Quit: Client closed]
demindiro has joined #osdev
<demindiro> So from what I can tell a bunch of fts_* functions in glibc use fts_build internally, which does go through all entries and puts them in an array. It also sorts them with user-supplied `compar` function if specified.
<demindiro>     /* Sort the entries. */
<demindiro>     if (sp->fts_compar && nitems > 1)
<demindiro>         head = fts_sort(sp, head, nitems);
<demindiro>     return (head);
<demindiro> fts_sort doesn't appear to do an I/O calls
chdla has quit [Quit: Leaving]
demindiro has quit [Quit: Client closed]
smach has joined #osdev
demindiro has joined #osdev
<ddevault> what if I spent all of my time working on my kernel and none of my time working on my userspace
<zid> Click here to recover trace amounts of paperclips from this message.
Matt|home has quit [Quit: Leaving]
sdfgsdfg has quit [Quit: celebrate free speech \o/]
dude12312414 has joined #osdev
les has quit [Ping timeout: 246 seconds]
Burgundy has joined #osdev
les has joined #osdev
bauen1 has quit [Ping timeout: 272 seconds]
<demindiro> OK, I tried rm -r with a million files and it does indeed have a limit on the amount of entries it fetches in one go
<demindiro> Which means I'm kinda in trouble
<demindiro> Anyone got ideas on how to iterate a hashmap while mutating it? My first idea is to add an index to the next & previous entry to each entry but that... meh
<zid> you only care about removal though?
<zid> removal is easy to deal with, remove it
<zid> actually, what edge case is even a problem here
bauen1 has joined #osdev
<demindiro> I'd like to make it work properly for adding files too though
<demindiro> In the case of removal I could just avoid shrinking the map, not so much with creation
<zid> what defines properly though? is readdir not allowed to be decoherant if I called opendir 4 years ago?
<demindiro> Good question, I'm trying to figure that out too, but from what I can tell readdir is supposed to return all files that haven't been added or removed even if you called opendir 4 years ago.
<zid> return files that haven't been added? That sounds tough
<zid> readdir_esp
<demindiro> As in: any files you added after opendir
<zid> your only constraint then is to not return the same file twice
<zid> the easier methods are easier but have peculiarities eh
smach has quit []
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
demindiro has quit [Ping timeout: 260 seconds]
heat has joined #osdev
<heat> <demindiro> But nothing about other files <-- hmm?
<heat> that clause is pretty explicit "if you remove or add an entry on a dir, unspecified whether it shows up"
<heat> I can tell you that in linux (and I assume most classic implementations of this shit) they will show up
<heat> in fact, you'll be able to see the same entry multiple times if you rm-add-rm-add-rm-add
<heat> (well, if the filesystem dirents are structured in that way)
<heat> getdents (the syscall readdir uses) is literally just a fancy read
<zid> yea I bet some stupid thing relies on it somehow though
<zid> but the trivial implementation does it 'well enough'
<heat> on what?
<zid> on computer
demindiro has joined #osdev
<demindiro> heat: the way I read that it only applies to the added/removed entries themselves, not other entries
k0valski18891 has quit [Read error: Connection reset by peer]
<heat> yeah
k0valski18891 has joined #osdev
<heat> in all likelyhood you probably need to establish a way to order the directory entries straight up
<demindiro> That said, I did a thought experiment where a directory is just a dumb array and concluded that it's impossible to return other entries exactly once if all you get is an offset in the readdir() call (on the server side).
<demindiro> So I'm going to dig in Linux sources and see what exactly they do for the simpler filesystems
<heat> they do just that
<demindiro> They do return other entries exactly once?
<heat> ext2/3/4 are just seeks on the directory inode plus ext4_dir_entry -> struct dirent
<heat> no, I meant that the simpler filesystems are literally just like a "dumb array"
<heat> even if they make hash tables out of that
invalidopcode has quit [Remote host closed the connection]
invalidopcode has joined #osdev
Brnocrist has joined #osdev
<heat> fyi ext4 is able to "accidentally" replay dirents it seems
<demindiro> Even those that weren't added or removed after opendir?
<heat> yes
<demindiro> Neat
<demindiro> Thanks
<heat> I don't quite understand this though
<heat> it only does that if something goes very wrong
<heat> basically when a directory is changed in the middle of a readdir they replay the block and if something looks wrong they just stop replaying
<heat> I imagine that then later checking skips the block or errors out or something
smach has joined #osdev
awita has joined #osdev
gog has quit [Quit: byee]
demindiro has quit [Ping timeout: 260 seconds]
awita has quit [Ping timeout: 268 seconds]
smach has quit []
bauen1 has quit [Ping timeout: 256 seconds]
xenos1984 has quit [Ping timeout: 248 seconds]
xenos1984 has joined #osdev
awita has joined #osdev
smach has joined #osdev
<heat> aw C23 doesn't allow emoji as variable names anymore
<heat> smh
<zid> oh they canned that?
<sbalmos> you were going to declare your PMM static var as Mr. Smily Shitpile?
<heat> Implementation-defined characters whose corresponding code points in ISO/IEC 10646 (Unicode) have the XID_Start or XID_Continue property can appear in the beginning or after the first character of an identifier respectively.
<zid> _
<zid> Then do the linker option to strip _
<zid> flawless plan
<heat> el plan
<heat> _<emoji> is a reserved identifier
<heat> el plan failed
<zid> _ then capital is reserved
<zid> is aubergine a capital vegetable
<heat> every external identifier that starts with a _ is also reserved
<zid> reservd for emoji escape use
<heat> so it's valid IF you static aubergine
xenos1984 has quit [Ping timeout: 246 seconds]
<heat> " In particular, the order of parameters in function declarations should be arranged such that the size of an array appears before the array. The purpose is to allow Variable-Length Array (VLA) notation to be used."
<heat> EW
<heat> WTF
<zid> ew
<zid> where are they recommending that?
<heat> it's a new C23 principle
<bslsk05> ​www.open-std.org: WG 14 N 2611 -- C23 Charter
<Ermine> O_O
<zid> What.. is, vla notation for functions?
xenos1984 has joined #osdev
<heat> void func(size_t N, char str[N])
<zid> never heard of it, only [static N]
<zid> well, static n
<zid> where n is const
<zid> seems like a great way to crash a random function at least
<heat> no
<heat> it's not a vla
<zid> the fuck does it do then
<heat> it's VLA-like notation but char str is still a pointer
<heat> it's just a way to annotate str is a pointer to N chars
<zid> I mean, so is the existing static n notation, and it even gives warnings
<heat> exactly like void func(char str[5])
<bslsk05> ​godbolt.org: Compiler Explorer
gog has joined #osdev
<heat> https://godbolt.org/z/8697KK8KT lmao clang O2 goes wiiiiiiiiild
<bslsk05> ​godbolt.org: Compiler Explorer
Imk0tter has quit [Ping timeout: 268 seconds]
<bslsk05> ​google.github.io: Welcome to Comprehensive Rust 🦀 - Comprehensive Rust 🦀
<mjg> what's your excuse now mofo
smach has quit []
<heat> oh that's cool
<heat> mjg, rust freebsd kernel whennnn
<mjg> there was a driver in rust
<mjg> true stor
<mjg> sysctlbyname patch whennnn
<heat> i'll do that on christmas eve
<heat> sorry, can't talk to you family, i have a freebsd to patch
<heat> the true BSD experience
<mjg> would they even hear you from the basement?
<heat> I don't live in the basement, I live under the stairs
<heat> or under the bridge sometimes
<mjg> waiting for you UC Berkeley letter?
<Ermine> I guess it's hard to talk about Rust without inserting crab emoji?
<heat> berkeley school of shit code and LSD
* mjg ingests a line
<mjg> lemme tell you something
<mjg> branches and pointer chasing are free
<heat> the S in berkeley stands for safe programming
<kaichiuchi> hi
scripted has joined #osdev
<scripted> Can I create a separate memory region for my ramdisk and write to that region by creating a simple unix file system with binary trees which also works?
<scripted> I made a similar approach while implementing my heap allocator
bauen1 has joined #osdev
Dreg has joined #osdev
terminalpusher has joined #osdev
terminalpusher has quit [Remote host closed the connection]
spikeheron has quit [Quit: WeeChat 3.7]
wand has joined #osdev
spikeheron has joined #osdev
wand has quit [Client Quit]
wand has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<sortiecat> scripted, well, sure?
<sortiecat> Some of the big questions of course is where the bootloader places the ramdisk which is probably arbitrary in practice since it varies with memory layouts
<sortiecat> Then the question is what format do you use? A standard format such as .tar maybe? Or maybe an existing filesystem like ext2 or squash fs or something?
<sortiecat> The biggest question is what format do you want at runtime? Do you want the ramfs to be writable? That massive changes things too.
<sortiecat> Things like .tar doesn't have an efficient index, while ext2 has all sorts of complexity for writing support
<sortiecat> If you want it read-only, you might want a simple image that you can mount and maybe unmap when you're done with it, and maybe build an index. On the other hand, you will need a lot of dynamic complexity if you want it writeable
<sortiecat> Personally I made my own initrd format by taking ext2 and removing all of the features needed for writing and ended up with something custom and minimal but powerful and efficiently mountable since it had directory indexes. This was very useful when the filesystem was read-only.
<sortiecat> But then I implemented a dynamic writeable ramfs using C++ objects and recursive trees and such, and suddenly my boot sequence basically extracted the custom initrd into the kernel ram filesystem by coping the data
<sortiecat> So these days I should just use .tar instead of the custom format since I'll basically unmap the data as soon as I'm done with it, it just scans through it once, so all of the custom features are unused in practice
<sortiecat> scripted, those are my experiences with ram filesystems in osdev :) Hope it's useful!
sortiephone has joined #osdev
sortiecat has quit [Quit: Leaving]
wand has quit [Ping timeout: 255 seconds]
<scripted> sortiecat, sorry I was focused on coding. So I haven't chosen any of the filesystems but went with a simple unix filesystem where you treat everything as a file.
<scripted> if you're interested, this is how I defined basically the struct of the filesystem: https://pastebin.com/pJjQYnvy
<bslsk05> ​pastebin.com: // Code from CrazeOS #define MAX_FILES 256typedef struct file {struct f - Pastebin.com
Matt|home has joined #osdev
<scripted> I'm trying to keep it simple because I wanna implement user space as fast as possible (kinda my goal of osdev), but I'd love your feedback
sortie has joined #osdev
<sortie> scripted, hey whatever works for you :) It's totally legit to get to user-space quickly, it's very motivating to get that far and you can improve later
<sortie> The MAX_FILES array is a bit weird instead of dynamically allocating nodes with e.g. malloc
<sortie> But totally get it, if you're at the point where you're making an user-space, you want to just stash a couple binaries in there, like definitely a shell, maybe an init, probably an ls and cat and such
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
radens_ has joined #osdev
sortiephone has quit [Quit: Quit]
chibill has joined #osdev
<heat> if you do ram filesystems properly the page cache and directory cache do the whole thing
<heat> you could also just use ram as a block device and get a real filesystem there
<heat> im starting to think that I should've used glibc all along
<mjg> not only that
<mjg> linux
<heat> hmmmm or freebsd libc
<heat> they don't even want fucking parameter names in the headers because it's "creative content"
<zid> you should use windows
<zid> it's much more stable and everything works
wootehfoot has joined #osdev
<zid> poor `double` btw, gcc has an option to speak badly of them
<zid> -malign-double
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<scripted> sortie: I have implemented malloc already. So you say instead of putting a limit to it I should allocate to the heap
<sortie> Usually just good coding style yeah
<heat> that's what the heap is for, yeah
<scripted> Doing that wouldn't suit my purpose because I statically fixed the heap to a specific address range and it would overlap with my file system
<heat> don't
<heat> also, what?
<scripted> like, 0x30000 is beginning address for heap
<scripted> and 0x50000 is beginning address for file system
<scripted> this might not be a good practice
<heat> it is not
<scripted> well, it works
<heat> how do you even define an address for "the" filesystem?
<heat> is this your initrd or whatever?
<scripted> yup
<heat> do you not have paging yet?
<scripted> i make a pointer to the beginning address of the filesystem memory region
<scripted> nope
<heat> well, get it
<heat> also, wait, what? you're loading these data structures directly from the initrd?
<scripted> well.. yeah
<scripted> basically what I do is create a pointer to the start of the memory region and work my way from there
<scripted> first creating the file structure over the entire regions and making it free
<scripted> till the entire memory region is filled with that data structure
<sortie> scripted, a generally useful design is to make the heap very big (that's why it's called the heap) and useful for m,
<sortie> for many, many variably sized allocations for any purpose
<scripted> currently it has about 1mb of address space
<heat> you're loading random pointers into an initrd and then using them as is?
<sortie> Then things like filesystems and everything else can be implemented on top of the heap
<scripted> i can increase it sure
<sortie> E.g. you implement malloc and free and use those everywhere
<sortie> (and then later on, you may want different allocators for special purposes to be more efficient, but just using malloc when in doubt is a good and fine design for a long time)
<scripted> heat : no, im not loading just random pointers and leave them as is. I have the first pointer as a static address of the beginning of the memory region and then increment that address by the sizeof the struct.
<sortie> (Later on, you'll want the contents of files to be page aligned, so you can memory map them, but that's not needed for a long time unless you want to)
<scripted> sortie: I've thought of using the heap, it makes it less work
<scripted> so basically allocate the root file structure and work my way from there
<sortie> The heap is natural because your filesystem is going to be a bunch of objects that point to each other, and then you got some file contents that may be specially allocated (or not)
<scripted> i see
<scripted> so i might as well just dump my separate identical memory allocator i just wrote
<heat> you need to get proper memory management
awita has quit [Ping timeout: 272 seconds]
<scripted> heat : whats wrong with my memory managment? besides that im not using paging
<heat> you don't have a page allocator
<scripted> so i dont have paging
<heat> page allocators don't have anything to do with paging
<sortie> Paging is well optional at that point
<heat> paging is not optional.
<sortie> You can build a malloc / heap without it
<sortie> heat, sure it is, until you go user-space
<heat> paging is not optional because most of proper memory management concepts revolve around paging
<sortie> scripted, but yeah, if you want a user-space, you definitely want to go for paging
<scripted> hmm, I see
<scripted> do I need paging for a heap allocator?
<heat> this is why nommu systems SUCK and are only used for small things
<scripted> or can I just do it like statically assign the address?
<heat> no
<heat> get a page allocator, get paging
<sortie> heat, you gotta remember it's a brand new osdev project, this person is just trying to get to something initial, so it's fine to skip things that are not truly required, but still point in the right direction
<scripted> its not really new
<scripted> more like an old project
<sortie> Well new as in how far it is
<scripted> yeah
<scripted> i regret using ANSI C
<sortie> You can technically do a user-space without paging
poyking16 has joined #osdev
<sortie> If you make sure the processes don't overlap
<scripted> i technically could write a memory allocator without paging
<heat> doing filesystems and dollar-store memory management before having MMU, heap, page allocation is very much stretching it
<sortie> scripted, but at some point, you really really gotta build things properly
<scripted> yeah i ssee
<scripted> so well
<scripted> i should dump my heap allocator as well
<sortie> The paging and memory management is going to be really essential and useful
<heat> most of scripted's confusion comes from the fact that they don't have any sort of proper memory management at all
<scripted> okay so, first i gotta setup this paging
<scripted> So I dont have these static addresses
<scripted> right?
<heat> well, having an MMU helps but you'll still need to find ways to get addresses dynamically
<scripted> okay, but what is wrong with my way of having the heap allocator
<scripted> is it because the processes overlap? should each program have its own heap?
<heat> you're allocating a fixed size memory region to hold your heap, you don't know if you actually have memory at that address
<scripted> why dont i?
<heat> your heap is remarkably small, you're trying to create a separate heap(?) for your filesystem
<scripted> if i put the data structure all over that range, i can see what is free and what is not
<scripted> heat: yeah, well like i said i had the idea of using the heap for my file system
gareppa has joined #osdev
<heat> you won't if you have less than 0x30000 bytes of RAM
<scripted> if i do have more than 3mb of ram
<scripted> i do know, right?
<heat> in practice yes, in theory absolutely not
<heat> the BIOS/bootloader gives you a list of memory ranges
<heat> you can only use exactly those
<heat> if you look at the lower 1MB you'll notice it's a total minefield of weird legacy ranges
<scripted> hm
<heat> now, it mostly stops at the 1MB mark and re-starts at just before the 16MB mark or the upper 4GB range (depending on how legacy your system is)
<scripted> so the only reason i need paging is for multi processing
<scripted> i dont get the other point yet
gareppa has quit [Client Quit]
<heat> no one said anything about multi processing
<scripted> so for what do i need paging then?
<scripted> i understand with paging a program can get virtual addresses instead of using physical ones, but how does that benefit my heap allocator
<heat> memory protection, being able to map memory dynamically to fixed addresses, being able to remap the same memory at different addresses, being able to map fragmented memory chunks into contiguous virtual memory
<scripted> doing this with plain physical addresses would do?
<heat> and then later on pulling all sorts of fun virtual memory tricks
<heat> you can't do any of the above with physical addressing
<scripted> why not
<heat> how would you
<scripted> i dont know
<heat> the premise of an MMU is *literally* that you can do this sort of stuff
<heat> without it, you can't
<scripted> hm, i see
<scripted> so without MMU it'd be a pain in the ass to not overwrite other process memory right
<scripted> that too
<heat> yes
<scripted> otherwise i would have to somehow dynamically allocate new memory regions, which is the job of the mmu
<scripted> by creating virtual address space
<heat> you will want to eventually dynamically allocate virtual address space
<heat> but when starting off you can't just do a cheesy strat and allocate certain ranges for certain things
<heat> can*
<scripted> Ok well thank you, I will try to understand paging more deeply
<heat> this works with the MMU because the MMU is deep magic and the bestest thing ever
<scripted> now i have to write this black magic into C code
<heat> sure
<heat> it's fun
sdfgsdfg has joined #osdev
<heat> and an essential element of most real operating systems post-early-80s or so
<scripted> do i need something with a mmap?
<scripted> i remember this term
<scripted> like 5 months ago
<heat> mmap? that's a system call
<scripted> i know that multiboot passes it
<heat> oh
<heat> yes you'll need to look at the memory map for page allocation
<scripted> gotta love ChatGPT
<scripted> explains osdev topics 10x better than 5 pages of osdev wiki
<scripted> no offense
<heat> sure...
<heat> that's not exactly a great idea but whatever floats your boat homie
<scripted> i wasnt trying to offend
<scripted> but its helping out a lot
<heat> 5 pages of osdev wiki are not enough to explain these concepts
<heat> you need a lot more and magical-slightly-misleading-robot-chat won't help you shorten things
<scripted> sure, it doesnt
<scripted> but it surely helps out pretty good
<heat> if you say so
<zid> heat explain porto to me instead
<zid> the only word I know is bordo
<heat> porto? the city?
<zid> The langwitch
<heat> uhhhh uhhhhhhh uhhh
* heat runs
<zid> he's a fraud, can't actually speak it
<zid> been pretending all this time, that's why his knowledge of british memes is so good
<zid> he's secretly an englisher
<heat> i'm a porto because I go to nandos a lot
<zid> I only go to the smaller nandos down the street, nandito
<heat> nandinho
<zid> (I've never eaten at a nandos)
<heat> you're the least portuguese englishman
<zid> nandos is south african though?
<heat> nandos was founded by a portuguese guy and the literal name of the restaurant is the shortened version of his name
<heat> and, ya know, this thing: https://en.wikipedia.org/wiki/Rooster_of_Barcelos
<bslsk05> ​en.wikipedia.org: Rooster of Barcelos - Wikipedia
<kazinsal> dang now I want nandos
<zid> kazinsal's driving
<zid> pick up heat in porto, swing past my house, hit up a nandos
<heat> noooooooooo dont drive, take public transportation
<zid> to portugal and back?
<heat> kazinsal to lead a multi-national effort in trans-atlantic public transportation
<kazinsal> a) there's a nandos like, 3km from me, and b) there's almost two feet of snow out there I'm not driving anywhere
<zid> the fuck do you live that you have nandos AND snow
<kazinsal> canada
<zid> ah, mystical snowland
<kazinsal> though this is definitely the most snow vancouver has had in at least a decade
<kazinsal> definitely cleared the 2008 snowstorm mark by now, probably gonna clear the 1996 record as well
<zid> I've never seen snow that didn't make things wet
<zid> heat has never seen snow
<heat> i have not
<kazinsal> snow itself isn't that bad. it's when it starts to warm up a bit and melt and then freeze again overnight and now you've got snow with a layer of ice on top of it
<kazinsal> and it does that cycle over and over for a week
<zid> Yea we *only* get that
<zid> The coldest we get is like, -2C
<zid> so we get very minor snow, mostly rain, and it just freezes and melts and freezes
<zid> but only for like, a week of the year, so nobody has any way to deal with it to hand
<zid> "Watch out there's black ice" "Okay I'll drive as normal and just hope not to die"
<kazinsal> we're supposed to get another 20cm tonight ._.
<zid> so is heat
<kazinsal> goodness
<heat> lol
sdfgsdfg has quit [Quit: celebrate free speech \o/]
Gooberpatrol66 has quit [Ping timeout: 246 seconds]
<scripted> fuck yeah
<scripted> i did it
<scripted> i wrote the page allocator
<bslsk05> ​pastebin.com: // written for CrazeOS#include <stdint.h>#include <stddef.h>#include "pagi - Pastebin.com
<scripted> is this good enough?
<scripted> I tested it already, it should work
<heat> well, no, you're allocating huge chunks of pages that way
<scripted> isnt that what i should do?
<zid> heat: you didn't teach many any words :(
<heat> scripted, no
<heat> zid, what words do you need
<zid> I, am, you, hate
<j`ey> bruxia
<heat> eu, sou, tu, ódio
<zid> eu sou ódio tu
<heat> if you want hate as a verb, odeio
<zid> yes, hate as a noun is hatred innit?
<zid> eu sou odeio tu
<zid> I am hate you
<heat> hate is also a noun
<heat> that still doesn't work
<heat> if you want to say "I hate you", "eu odeio-te" or simply "odeio-te"
<zid> No, I am the hatings you sir.
<heat> you should take some notes for when you come here on vacation
<zid> where did the ó go on the o btw
<zid> are we like english where record and record are pronounced differently if noun or verb
<zid> also how does stress timing work real quick
linkdd is now known as dunder
dunder is now known as linkdd
<heat> the "o" part in ódio and odeio is pronounced the same because portuguese is great
<zid> so it's like french's o^ where it's just there to let you know that french is silly
<heat> no
<heat> it has its purpose sometimes
<zid> so does french, mainly for complaining in canada
wootehfoot has quit [Read error: Connection reset by peer]
<heat> mdr
<zid> mon deuxieough
<heat> my secondough?
<zid> that's just how you spell mon dieu in french
<heat> what language is mon dieu then
<zid> latin
<heat> merda = shit
<zid> imo everybody should speak a sort of modern latin, with some german words thrown in for some representation of germs and slavs
<heat> merde = merda
<heat> that'll be 50 an hour
<heat> heat - expert language coach
<zid> we can get rid of grammatical genders though
<heat> no
<zid> That's the perfect language imo
<zid> latin/german mix, no gender, maybe have some highly integrated country testbed it for a while to work out all the kinks and give it a real 'lived in' feel
<heat> grammatical genders are great because 1) they're part of my native tongue 2) they make americans try to come up with stuff like latinx
<zid> is latinx what americans write instead of latinas/latinos
<heat> yes
<zid> is there a better way to do that
<heat> no
<heat> i mean, yes
<zid> latingays
<FireFly> "latin people"?
<heat> you just say latino which applies to both ig
<zid> latinian
<zid> people from latin
<heat> this sort of language shit is only a problem if you make it one
<heat> FireFly, i mean, yes? but latin is more of a roman thing
<heat> latino/a is the proper latin america stuff
<zid> are romanians latinx
<heat> no
<zid> too many feral dogs, got it
<kazinsal> I never never met a latino/latina who has actually promoted use of latinx
<zid> What if they're a skiier at the olympics
<zid> and that year they're hosting it in peru
<zid> rofl
<zid> "they sound like a Roblox character dying whenever they talk about eggs"
awita has joined #osdev
awita has quit [Remote host closed the connection]
scripted has quit [Quit: WeeChat 3.7.1]
<jjuran> "Latinx" is a poor neologism because it's not at all obvious how to pronounce it
<zid> latin..x
<jjuran> Sure, but it could be "lah tinks"
<zid> no?
<jjuran> Also, letters prnounced as their names should be capitalized and hyphenated, e.g. A-trap, X-wing
<zid> You'd need to assume it's an unrelaed word formed from the non-existant latin prefix lah, and non-existant root word tinkx
<jjuran> It's a made-up word; I don't need to assume anything
<zid> That's.. not how language works though?
<zid> Constabulation is a word I just made up, you don't think it's a type of chemical
<zid> because it ends in -ion
<jjuran> I don't think about it at all
<mats2> latinx is a scam
<heat> tbf before I heard latinx pronounced I would assume it's pronounced "lah tinks"
<mats2> ask a south american national and they will not know what you're talking about
<zid> because it's about them, not by them
<mats2> dumb north americans making shit up
<zid> japanese people also don't know what weeaboo culture is
<jjuran> My point is, if you're going to make up a word that suggests Latino or Latina without specifying, at least come up with "Latine"
<mats2> they 100% know about weeb culture
<heat> latine would just get pronounced latin
<jjuran> Well, Latín
<jjuran> And people would still know what you mean
<mats2> libs are just mad that there are genders
<heat> latino IS the gender neutral form
<zid> latine would be la-tiin
<jjuran> And the plural of Latín would still be Latines
<zid> in anglais
<mats2> the world's top scientists should figure out how to make all future generations are transgendered
<mats2> dongs and vageens for everyone
<heat> please stop with the politics thanks
<mats2> and then you can go fuck yourself
<heat> i should remind you that we were talking about linguistics and not politics
<jjuran> I'm only in it for the wordsmithing
<mats2> linguistics is inseparable from politics
<heat> it's not.
<mats2> americans think everybody with a white complexion is white
<zid> isn't mats2 the one who always shows up and calls us pussies
<zid> then disappears again for 2 weeks
<mats2> northern europeans would disagree that italians, greeks, other southerners are white
<heat> blatant lie
<zid> is also apparently racist
<jjuran> Ready to drop the hammer and dispense some justice?
<mats2> who is white is mostly defined by recent immigration and nativist trends
<Mutabah> WFT is going on her this morning?
<mats2> i didn't start it
<zid> mats doing mats things
<heat> we were talking about linguistics and someone turned this into a politically charged argument
<jjuran> mats is insulting people and suggesting that they perform impossible acts
<mats2> i've watched videos where people fucked themselves with their own genitalia
dude12312414 has joined #osdev
<mats2> empirically possible
<jjuran> This is off-topic
<Mutabah> ^
<mats2> k afk
dude12312414 has quit [Remote host closed the connection]
<Mutabah> Please return to on-topic conversation
<sortie> Hello I'm here
<heat> how about them pages eh
<Mutabah> Hey sortie
<sortie> Mutabah, it's me!
<sortie> And it's you!
<jjuran> :D
<sortie> Yay the good times!
<zid> he's always like this, shrug
<sortie> zid, I know right? That sortie. What a character.
<zid> sortie: I wish he'd stop but he refuses to take the tablets
mats2 was kicked from #osdev by sortie [kthxbai]