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
nikolapdp has quit [Ping timeout: 240 seconds]
theyneversleep has quit [Remote host closed the connection]
heat has joined #osdev
<heat> mjg: it's not unreasonable to make install safe by default
<heat> sooo
<heat> if shit slows down, tough shit
<mjg> which part of "fsync being added for no reason" you don't understand
<zid> There really needs to be a better api than fsync
<heat> what part of "fsync is there for a reason" don't you understand
<zid> for doing file updates
<heat> there is
<heat> fdatasync
<mjg> they are claiming they are fixing a problem where the target file is in use as it is being installed
<mjg> and they are fixing it by using a temp file and rename, which makes it atomic
<mjg> existing code which happens to roll with temp file and rename also does an fsync
<mjg> which is of no significance to the problem they are addressing
<zid> I said better not more worse :P
<zid> it has to imply the semantics of what you want from a sequence of calls, RISC FS
<mjg> the problem here is that when install is used, there are literally hundreds of files to slap in
<mjg> by fsyncing every single one you are shafting i/o for no reason
<CompanionCube> isn't this stupidity what dpkg does?
<heat> it's called
<heat> data safety
<zid> portage installs shit to a sandbox first
<heat> data safety is implicitly PESSIMAL
<zid> so that it can undo if anything goes wrong trivially I guess
<zid> atomic 'big update of a lot of files' is hard
<zid> per-file is easy, but you'd need like, a transaction thingy to do it properly for package installs
<mjg> for the cases where "data safety" is important, there already is an option to provide it
<zid> else you might have updated ld.so.6 but not ldcache binary or whatever idk
<heat> i don't know what kind of install usage *doesn't* require data safety
<mjg> here is a trivial example from the ports tree
<mjg> you install into a staging area
<mjg> that shit then gets packaged
<mjg> and rm'ed
<zid> there are lots of cases where you don't really give a fuck because it's not important
<zid> because you're only installing headers, a binary, and a man page or whatever
<zid> and nobody cares if when you hit 'man' on a package that you're updating, you might get the old or new one deepnding how far through the install you are
<kof673> it says installworld as an example, and that cronjobs might get screwed up. ye olde instructions IIRC you were supposed to boot to single-user mode to installworld, so i am left wondering what the use case is
<mjg> except now, instead of hopefully never even hitting storage, these files will get written out cause fsync
netbsduser has quit [Ping timeout: 252 seconds]
<zid> but for .so + binary or whatever, you care
MiningMarsh has joined #osdev
<mjg> kof673: the problem they are describing is fixed with temp file + rename, fsync literally not playing any role here
<kof673> sure sure sure i am just out of date on installworld
<heat> ok
<heat> i mean, i use cp in my install: targets
<heat> so
<mjg> good for you mofo
<mjg> meanwhile the shittery in freebsd uses install all over the place
<mjg> including for stuff facing immediate removal
<zid> need to cp them to temporary dir on the same fs first so that the real cp is nice and fast, sill
<mjg> meanwhile they handwave fsync being there with "atomicity being worth it", despite fsync not being a factor
<mjg> for the stated problem
<Mondenkind> wer transactional dbfs
<Mondenkind> posix fs is a racy mess no matter what you do
<zid> heat: Okay how about this, instead of transactions, we add a BFL
<heat> what's a bfl
<zid> it's like a big kernel lock, but it's a big filesystem lock
<heat> lgtm
<heat> OPTIMAL
<zid> and we just stall out all syscalls until the 'transaction' is done. very minimal code changes!
<mjg> transactions here are plausibly doable with zfs
<heat> yes but what about those that do not use shit filesystems
<Mondenkind> zid: just write the kernel in python and you get that for free
<zid> heat: They can implement their BFL per-thread and then do what posix does now, imply meaning from a string of syscalls in full
<Mondenkind> mjg: interesting, how so? i can see cow helping with mvcc, but that's not enough
<zid> if it supports proper transactions internally it can just use them to implement the BFL :P
<mjg> Mondenkind: not without further work, but broad strokes: you mount a snap under /lulupdate, make changes over there, then invoke a syscall to atomically replace the mount point with the new snap
<mjg> Mondenkind: it could even fail if other changes were made
<heat> >snap
<Mondenkind> oh so not actually coping with concurrent writes
<zid> is that the sound you get if you drop the POSIX manual on your leg
<Mondenkind> still, that would be a big improvement over the current state
<heat> actually the POSIX spec isn't that big
<heat> i have a pdf of it somewhere
<mjg> i'm not claiming this would do anything for arbitrary changes
<zid> You're thinking of 'crunch', that's the zfs code listing
<mjg> i am claiming for *system updates*, where things is assumed sane and only needs safety belts
<mjg> it does sound doable
<zid> posix is a nice clean break
<mjg> s/is/are/
* Mondenkind nods
<kof673> i'm still lost on why a cronjob is monitoring installworld. are they installing somewhere for a jail/vm/whatever? anyways...
<mjg> it's not monitoring anything
<mjg> it is running as installworld is running
<mjg> and using files being replaced with ^^
craigo has quit [Ping timeout: 240 seconds]
<mjg> if you are unlucky enough, boom
<kof673> yes, i just don't know when that was ever allowed
<mjg> technically it's not legal
<kof673> lol i'm not saying it is bad, just if that is what caused the issue to need to be fixed then...
<mjg> it very much can still break
<kof673> *"fixed"
<mjg> for example if 2 .so got updated and you need both, but you squiezed yourself into a window where you see one
<mjg> they are basically reducing breakage, but defo not fixing it for the stated scenario
<mjg> i checked gnu out of curiosity, it does the temp file thing, but no fsync
<mjg> interestingly does not do copy_file_range
<mjg> someone should probably patch that
zxrom has quit [Quit: Leaving]
netbsduser has joined #osdev
<heat> mjg: would not be surprised if copy_file_range is fucked up wrt datasync
<heat> one must assume all filesystems are very fucked in almost every call
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
netbsduser has quit [Ping timeout: 264 seconds]
edr has quit [Quit: Leaving]
stolen has joined #osdev
netbsduser has joined #osdev
kof673 has quit [Ping timeout: 268 seconds]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
heat has quit [Quit: Client closed]
netbsduser has quit [Ping timeout: 272 seconds]
terrorjack has joined #osdev
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
Fingel has joined #osdev
netbsduser has joined #osdev
vdamewood has joined #osdev
gbowne1 has quit [Remote host closed the connection]
netbsduser has quit [Ping timeout: 252 seconds]
rustyy has quit [Quit: leaving]
gbowne1 has joined #osdev
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #osdev
rustyy has joined #osdev
netbsduser has joined #osdev
netbsduser has quit [Ping timeout: 260 seconds]
zetef has joined #osdev
rorx has quit [Ping timeout: 256 seconds]
rorx has joined #osdev
netbsduser has joined #osdev
gildasio has quit [Remote host closed the connection]
netbsduser has quit [Ping timeout: 240 seconds]
gildasio has joined #osdev
Fingel has quit [Quit: Fingel]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
stolen has quit [Quit: Connection closed for inactivity]
bliminse has quit [Ping timeout: 255 seconds]
bliminse has joined #osdev
zetef has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rustyy has quit [Read error: Connection reset by peer]
rustyy has joined #osdev
netbsduser has joined #osdev
gbowne1 has quit [Read error: Connection reset by peer]
netbsduser has quit [Ping timeout: 255 seconds]
cydox has joined #osdev
netbsduser has joined #osdev
nikolapdp has joined #osdev
xvmt has quit [Remote host closed the connection]
xvmt has joined #osdev
netbsduser has quit [Ping timeout: 260 seconds]
navi has joined #osdev
zxrom has joined #osdev
gog has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
GeDaMo has joined #osdev
bitoff has joined #osdev
bauen1 has joined #osdev
bitoff_ has joined #osdev
bitoff has quit [Ping timeout: 260 seconds]
bitoff has joined #osdev
<chiselfuse> i recently learned about mmio. on linux, could i be able to check which devices are mapped to which ranges of physical addresses using `sudo cat /proc/iomem`, `sudo lspci -v`, and `sudo cat /proc/vmallocinfo`? or are these not the actual physical addresses?
bitoff has quit [Max SendQ exceeded]
bitoff has joined #osdev
netbsduser has joined #osdev
<zid> lspci is correct
<zid> lspci -vvvvvv shows the BARs
bitoff_ has quit [Ping timeout: 252 seconds]
<chiselfuse> do you know what the others are? i am sceptical about /proc/vmallocinfo because i couldn't find much info online
<zid> for example my scsi controller has three regions, at 9ffe04000, 9ffe05000, 9ffe06000
<zid> and in iomem it's claimed by virtio-pci-modern apparently
<zid> 9ffe04000-9ffe04fff : virtio-pci-modern
<chiselfuse> i can't find which field is the BAR in lspci -vvvvvv
<zid> Region %d
<zid> There's 0 through 5, any number of which may or may not be filled out
<zid> the capabilities pointer often has more info about what each bar is supposed to be
goliath has joined #osdev
<zid> (For example the caps stuff tells me that bar 2 is for msi-x)
<zid> The driver already knows though so it's not super important
bitoff has quit [Ping timeout: 264 seconds]
spare has joined #osdev
bitoff has joined #osdev
bitoff has quit [Ping timeout: 255 seconds]
edr has joined #osdev
cross has joined #osdev
heat has joined #osdev
<heat> chiselfuse: vmallocinfo shows a list of vmalloc ranges (basically what linux calls virtually-mapped memory, the rest is usually more or less a linear 1:1 mapping)
<heat> some of those ranges are mmio mappings
<chiselfuse> heat: i searched for what vmalloc is but i couldn't understand. it's not the virtual address space of a userspace process of course, then what is it? are you saying it maps 1:1 with physical address space?
<heat> no
<heat> "basically what linux calls virtually-mapped memory, the rest is usually more or less a linear 1:1 mapping"
carbonfiber has joined #osdev
<heat> most things !vmalloc are 1:1 mapped to physical memory, vmalloc is actually virtually-mapped not-1:1 memory
<mjg> copy_file_range does mess you up
<mjg> anyhow bsd engineering ethos over at linux
<mjg> > kernel test robot noticed a -98.9% regression of stress-ng.key.ops_per_sec on:
<bslsk05> ​lore.kernel.org: [linux-next:master] [keys] 019e41d1be: stress-ng.key.ops_per_sec -98.9% regression
<heat> though note that for all intents and purposes vmalloc memory is always backed by pages, there's no demand paging for the linux kernel
<chiselfuse> so you're saying that vmalloc'd ranges don't map 1:1 with physical ranges. so then i wonder what "mmio" stuff in those vmalloc ranges mean. is it the ranges for mmio that appear in this virtual address space which is a kernel's internal abstraction of the physical address space?
<chiselfuse> sorry if it's dumb questions i'm not yet familiar with most things
<heat> the mmio stuff in those vmalloc ranges is 1:1 within that mapping
<heat> but not 1:1 in general
<chiselfuse> is there a resource where i can study the linux kernel (modern, not 2.6) after i get more familiar with x86?
<heat> various resources, most of them suck and/or are old
<chiselfuse> is there nothing that can at least give me a holistic view of the modern one after which i can study further through reading source code?
<zid> there's a bunch of stuff in Documentation/
<zid> for how various subsystems work in general, including memory
<heat> no there's no holistic view
<heat> linux documentation sucks
<heat> in general no one wants to write it except if they really need to
<zid> That's what books are for
<zid> books also suck though
<zid> but in reality, nobody needs to know how that code works other than the pepole who work on it
<zid> and if they work on it they're going to have to read the code regardless
<heat> linux has a strong deficit of technical writers willing to document things
<zid> it does however, have git blame
<heat> well that's not the problem, the problem is that the code is complex and hard to understand
<chiselfuse> how many core devs are there?
<zid> That's because the concept is complex and hard to understand
<zid> it does a lot of random shit
<heat> right, so write the thangz down
<zid> I refer you back to where we started
<heat> mm/vmscan.c is a 8000 line mess of a source file with a bunch of heuristics for page reclamation
<zid> and if you want to know what they are, you can read it, and git blame
<zid> and by want I mean 'need', this isn't recreational :P
<heat> and you'll take a lot longer than if someone just neatly wrote things down
<zid> how
<zid> it's 8000 line mess of heuristics for page reclamation, the mess of heuristics doesn't stop being a mess of heuristics
<chiselfuse> in general, do people in osdev like the design of the linux kernel over windows kernel or would you say that the linux kernel is uglily designed too?
<zid> just because I write on A5 paper
<heat> you'll have to parse and untangle an 8000 line source file
<heat> that's why
<heat> and then investigate wonderful interactions with other multi-thousand-line source files
<zid> but in a book that's trivial
<zid> ofc
<heat> one cannot fully understand linux mm without 1) being in the game for 20 years OR 2) being clinically insane and *really* dedicated
<heat> and they acknowlege this and acknowlege they need better docs and some clean up, but no one wants to write docs
<chiselfuse> can i build it with debug symbols and stop through it in qemu maybe?
<heat> because they're programmers and this is a FOSS project, so no one ever does anything that isn't writing code
<chiselfuse> s/stop/step/
<heat> you will be stepping through many thousands of lines of logic
<chiselfuse> i'll add breaks as appropriate idk :P
<Ermine> Clinically insane ✅
<Ermine> Onyx mm is much cleaner I guess
<heat> it is cleaner but it's because 1) less mileage 2) less features
Left_Turn has joined #osdev
<zid> fewer, smh
<zid> where's my whipping cane
<heat> i'm working on it boss
<heat> i'm not a MINIMALIST
<Ermine> "Clean" and "minimal" don't even correlate...
Turn_Left has joined #osdev
Turn_Left has quit [Max SendQ exceeded]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 256 seconds]
SophiaNya has quit [Remote host closed the connection]
ptrc has quit [Remote host closed the connection]
SophiaNya has joined #osdev
ptrc has joined #osdev
<heat> Ermine: sure they do
<heat> roughly at least
<heat> it's implicitly simpler
<heat> like one has to admit those insane s6 ideas about programs and web servers are pretty and conceptually simple
<heat> and elegant
<heat> they won't work as you need more features or as you need to scale up your thing, but the design is nice and pretty and you can easily draw it and be satisfied with the result
<heat> those ~9000 lines of page reclamation could significantly be cut down if you said swap is bad and bloated, or you could delete the whole feature if you said using more memory than you have is explicitly not supported
<nikolapdp> which isn't really a crazy thing to do
<nikolapdp> overcommitting is weird
<zid> I support overcomit but not swap, easy
<zid> you oom when you fault the memory in
<zid> and there isn't any
<heat> page reclamation is not about overcommit
<heat> you need to reclaim pages when doing IO for instance
<heat> would you only be able to do $RAMSIZE reads and writes before your kernel can't do anything further?
<heat> minimal people would say that's PEBKAC because 1GB of IO is plenty.
<zid> My ethernet driver uses the same pages over and over, yours sounds silly
<nikolapdp> lol
<nikolapdp> 1 GB is a lot for IO to be fair when most stuff works with a few pages
<heat> ???
<heat> my SSD has 22TB of writes over its lifetime
<heat> i'd love to tell you LBAs read, but i can't
<heat> would not be surprised if it's 100x the writes
<zid> I have good news for you, ring buffers
<heat> ring buffer of what exactly?
<nikolapdp> oh a few pages
<nikolapdp> not thousands
<zid> To reuse dma locations, so that you don't eventually do "$RAMSIZE reads and writes"
<zid> and run out of memory, because you can't free
<zid> io doesn't need to constantly churn, you just would rather free things
<zid> which reqiures.. free
<heat> i'm not talking about the IO itself, i'm talking about the page cache
<zid> and we're obviously not
<zid> We're talking about *not* using the exact implemtation of the linux page cache
<zid> I know you struggle to conceptualize "not linux"
carbonfiber has quit [Quit: Connection closed for inactivity]
<heat> i know you struggle to conceptualize "operating system concept that's on every operating system"
<heat> your idea doesn't work
zxrom has quit [Quit: Leaving]
<heat> you could have a ring buffer of N pages for reads and writes, wouldn't work for mmap
<heat> you'd need to *reclaim pages*
<nikolapdp> exactly
<nikolapdp> doesn't need to share pages with mmap
<heat> mmap-read/write coherence has existed since the 90s, and now you're looking to cut that and also run into similar hard limits but for mmap
<zid> yes, taht's what happens, when you don't allow overcommit
<zid> you run out of memory
stolen has joined #osdev
<Ermine> heat: you can have small codebase which is not clean. Like musl or qbe
<Ermine> think of those spells from dns_parse
<heat> the code isn't clean but the design is
<heat> like, draw a dependency graph between symbols and it'll be very very clean for a libc. draw a dependency graph between symbols for glibc-oh-why-does-it-bring-it-locale-code-and-malloc
<heat> glibc printf is fucking meta-generated from a bunch of CPP macros
<heat> int main(){puts("Hello");} will bring in stdio and iconv and malloc (etc etc) because there are extra use cases it needs to support
<heat> the clean libc design was polluted by dirty usage of stuff
<zid> IFUNC
<heat> the musl solution to locales is pretty much "por favor yo solo hablo ingles"
<zid> like onyx
<heat> onyx's PERFECT keyboard layout
<zid> Your solution to keyboard layouts is not to have one, each key just gives rand()%256
<nikolar> MINIMAL
<heat> yes its a MINIMAL solution none of that dynamic keyboard layout loading and compiling bullcrap
<heat> don't have a pt_PT keyboard? get one, simple as
<heat> anything else is BLOATED
<heat> no one uses other keyboards anyway and if you do you're wrong
spare has quit [Remote host closed the connection]
<GeDaMo> Just use a single morse key :P
<Ermine> Oh, so you're talking about global cleaness
xenos1984 has quit [Ping timeout: 260 seconds]
<Ermine> I was thinking of local cleaness, when you read the code and 'oh, I see what it does'
xenos1984 has joined #osdev
<heat> a complex design would be something like "the page scrubbing controller goes through the lru lists, applies 10 heuristics, compares this frobble group with other frobble groups, then carefully unfrobbles the pages in a specific order such that your system doesn't deadlock, if it fails the unfrobbling it'll re-scrobble 3x before killing your
<heat> process, if it succeeds it'll unguzzle the pages from all the processes and retry the page allocation again keeping in mind you've already unfrobbled your frobble group"
<heat> complex code is something like "all variables are single letters, all the 4 struct page * variables in this 400 line function are named p1, p2, p3, p4 and i don't use defines because the preprocessor is gay"
<gog> yes
<Ermine> Well, ok, anyway
<Ermine> Are fallout 1 players expected to read the whole vdsg?
<heat> finally, #falloutdev
<heat> i've had new vegas for a bunch of years but i always got bored 1hr in
<heat> same thing for skyrim. bethesda games aren't really my thing, sorry todd
Arthuria has joined #osdev
<nortti> isn't new vegas not-bethesda?
<Ermine> In internet people say that fallout 1, 2 and new vegas are TRUE and BEST fallouts
<Ermine> My friend says 1, 2 are boring
<heat> oh yeah new vegas wasn't bethesda nor todd
<zid> fallout alternates developers
<zid> generally, same as cod
<zid> I wish interplay didn't go bankrupt
<zid> black isle made cool games
<zid> fallout 1 was interplay, fallout 2 was black isle (part of interplay), fallout 3 cancelled due to interplay going bankrupt, black isle devs form obsidian, they release new vegas under bethesda as publisher, bethesda now has the rights and shits out fo3 and fo4 which suck
<heat> i think nowadays they don't exactly go tick-tock in CoD
Arthuria has quit [Ping timeout: 268 seconds]
<heat> fallout 3 was before new vegas btw
<zid> yea nv was supposed to be a spinoff, like brotherhood/tactics
carbonfiber has joined #osdev
freakazoid332 has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
zxrom has joined #osdev
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
<gorgonical> 1 and 2 are great games, but they are just older styles. Some of the last great crpgs
Cindy has quit [Ping timeout: 264 seconds]
<gorgonical> It took a while for me to get into them. I started with f3 but liked the setting and concept so much that I gavae 1 and 2 a real try and got very much into them
craigo has joined #osdev
<gorgonical> it has frustrated me to no end how shallow and mis-written the bethesda fallout games are
Cindy has joined #osdev
gog has quit [Quit: Konversation terminated!]
spare has joined #osdev
frkazoid333 has joined #osdev
stolen has quit [Quit: Connection closed for inactivity]
sbalmos has quit [Quit: WeeChat 4.2.1]
* Ermine succumbs to vs code once again
<heat> GNU NANO
<Ermine> the reason being jupyter notebooks
<heat> yeah vscode works pretty well for that
<Ermine> electron is the most tedious when it comes to wayland
gbowne1 has joined #osdev
bauen1 has joined #osdev
sbalmos has joined #osdev
sbalmos has quit [Quit: WeeChat 4.2.1]
xenos1984 has quit [Ping timeout: 268 seconds]
Arthuria has quit [Ping timeout: 246 seconds]
gog has joined #osdev
Left_Turn has joined #osdev
sbalmos has joined #osdev
<nikolar> It's almost like using the whole browser runtime to write a text editor isn't a great idea
Turn_Left has quit [Ping timeout: 268 seconds]
<heat> it's not the whole browser runtime
<heat> checkmate atheist
<gog> hi
xenos1984 has joined #osdev
<heat> gog
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nikolapdp> you're right heat, there's also a separate node server running
<gog> heat
<heat> gog
<gog> heat
<heat> gog
<gog> heat what do you want
<heat> cookie
<gog> same
<gog> i should have grabbed one at the store
<heat> two*
<heat> one for me
<Mondenkind> gog
Yoofie has quit [Ping timeout: 252 seconds]
<gog> Mondenkind:
<Mondenkind> gog can you get me a cookie too
<gog> yes
<Mondenkind> yay
<heat> yay -Syu
<heat> my yay is fucked cuz i used pacman and it upped the libalpm's so version and now yay can't update itself and now i need to do it manually sometime
<Mondenkind> oh yeah that's annoying
<Mondenkind> .oO( arch is TRASH worse than windows level package management engineering )
<heat> i'm pretty sure pacman can track .so version dependencies
<heat> so i think yay's PKGBUILD is at fault here
<heat> or makepkg is doing the wrong thing for some reason
<Ermine> yay desktop linux
<geist> hmm, surprised there isn't a static version of yay
<geist> like that seems to be a generally good idea
<Mondenkind> ditto pacman, come to think of it
<Mondenkind> $ ldd =pacman|wc -l
<Mondenkind> 33
<geist> i remember in the old days when i would update freebsd by source they had static versions of all the essential tools for this purpose
<geist> netbsd has some tools in /rescue that i think may be for this purpose too
Yoofie has joined #osdev
<Ermine> apk.static
<geist> ah i see /rescue in netbsd has a single hard linked 10MB binary that implements evertything
<geist> like 154 tools, i guess it literally has an uber linked rescue binary as part of the build process
<Ermine> having static busybox on a server is useful btw
<geist> that's kinda neat. busybox style, but in this case the real tools you get separately in /bin
<Ermine> because there's malware that can use LD_PRELOAD and fake syscalls
<geist> yah ldd shows zero external inkage
<geist> ah freebsd has the same thing. probably has for a long time, i just never noticed it
<Ermine> ldd should show that this is not a dynamic executable
<Ermine> at least it does so on linux
<heat> arch has pacman-static
<heat> worth noting that yay is not an essential system tool
<zid> does it have pacman tournament edition dx
<zid> steam does
<heat> yay is what some people use to install packages from the AUR (built from source, 3rd party stuff usually)
<geist> how much ISK does that cost?
<heat> thus this is not really a "linux desktop moment" because my mom should not be building packages from the AUR
<Ermine> heat: fwow static hello world is 3M with glibc and 76K with musl
<heat> yep
<Ermine> fwiw*
<Ermine> aur is unavoidable under arch linux
<heat> no it's not
<Ermine> it is if you want some actual software
masoudd has joined #osdev
<heat> i dropped the google-chrome aur package and moved to a flatpak, best decision of my life
<Ermine> e.g. i need hplip plugin for my printer
<heat> most desktop software has flatpaks, other software can usually be installed with a crappy installer or a tarball or something
<Ermine> and at some point I had libc++ for discord
<heat> i've grown to hate the AUR because you truly need to audit things
<heat> well, *should*
<Ermine> also lib32-gst-plugins-ugly for wine
<Ermine> It's like random repos from open build service when you are on opensuse
<heat> yes, or random ubuntu ppas
<Ermine> in my case i need ppas only for firefox and veracrypt
<Mondenkind> flatpak😱😱❌❌🤮
<Ermine> ^
<Mondenkind> i've grown to hate official package repositories because you truly need to audit liblzmas
<heat> god forbid software works without issues
<Mondenkind> well, *should*
<heat> i hate official package repos too
<heat> you realize arch linux devs can push whatever without any supervision right?
<heat> half-assed security process
<geist> fun ARM64 instruction i stumbled upon today: EXTR
<geist> it's a superset of ROR
<nikolapdp> is it short for extract?
<geist> yah
<bslsk05> ​developer.arm.com: Documentation – Arm Developer
<Mondenkind> x86 did it first
<geist> oh?
<Mondenkind> shrd
<geist> i kinda doubt it
<geist> hmm, lets see
<geist> ah yeah, indeed
<geist> didn't know about that one on x86 either
<Mondenkind> .oO( so when x86 does something it's 'disgusting' and 'cisc', but when aarch64 does it it's 'cool' and 'fun'. we really do live in a society😔 )
<geist> wow. okay.
<nikolapdp> lol
<geist> trying to work around ths warning: https://gcc.godbolt.org/z/EofG4GvMr
<geist> but i can't figure out how to tell gcc to shut up about that
<geist> yes i know i'm cramming a 64 bit value in a 63 bit bitfield, but it's shifted over and i know that
<nikolapdp> or it with 0x7ff..ff?
<nikolapdp> sorry, and it
<geist> nope
<geist> doesn't work
<geist> nor does pre-anding it with 0xff....e
<nikolapdp> eh smells like a bug potentially
* Ermine RORs
<geist> Ermine: yah ARM apparently implements ROR as a pseudo instruction to this one
<geist> ARM64 that is, ARM doesn't have it
<Mondenkind> geist: in c you can cast to unsigned _BitInt(63)
<Mondenkind> but doesn't work in c++
<geist> yah
<nikolapdp> huh yeah it did compile it as cpp for some reason even though it was run with gcc
<geist> well, the language is picked up in the drop down
<Mondenkind> i just passed -x c
<nikolapdp> oh duh i am being dumb
<nikolapdp> i did too
<Mondenkind> because if you switch the language in the dropdown it gets rid of the code
<Mondenkind> anyway i would pragma push to get rid of the warning
<Mondenkind> or stop using bitfields :)
<geist> yah in this case it's precisely because i need to pack a bool and a 64 bit value in.
<geist> i guess i can just or the bool with the val and move on with life
<geist> it's a space saving thing basically
<geist> in this it's the TLB flushing routine in the kernel, it's building a list of pages to flush and if they're terminal or not
masoudd has quit [Killed (NickServ (GHOST command used by masoudd_))]
masoudd_ has joined #osdev
<geist> so i guess since the addresse are 12 bit aligned i can just or it in, was trying to be nicer about it
<geist> <shrug>
<Ermine> vs code doesn't show function parameters hints :(
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<geist> yah fuck it i'll just do it manually: https://gcc.godbolt.org/z/G8YrPhxb4
<geist> bitfields are for chumps
<gog> hi
<geist> a gog!
<gog> s
<gog> when
Matt|home has joined #osdev
zetef has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 272 seconds]
<heat> google C++ geist with the nice pretty typesafety vs raw C geist with tha bitmaskz
zetef_ has joined #osdev
<geist> i was actually optimizing it from the current version, whcih uses some gnarly templatey bitfield stuff that's rolled in house
<geist> when i looked at the codegen it was terrible, actually emitting mutliple 8 byte memcpys to modify the bitmap
<geist> so i was just trying to convert it to a plain bitfield
<heat> oh isn't that what you use for nearly everything hw reg with bitfields?
<heat> or am i thinking of the wrong thing
<geist> it was a different one: FBL_BITFIELD
<Mondenkind> memcpys aren't optimised properly?
<geist> it's kinda neat, but under the hood it uses a bit union, and the code can be in some cases terrible for Some Reason
<geist> Mondenkind: well, sure, but this is something that you dont need memcpies for
zetef has quit [Ping timeout: 240 seconds]
<geist> it's just packing a 52 bit address + a bool into a single 64bit value
<geist> (to save space on the stack)
<geist> anyway https://gcc.godbolt.org/z/qdYz135xh is what i have now
<heat> yeah that looks okay
<heat> but type safety is LAME
<Mondenkind> getters and setters
<bslsk05> ​fuchsia-review.googlesource.com <no title>
<Mondenkind> geist actually in his java era
<geist> oh gosh no i haven't written java ever
<geist> and i intend on keeping that way
Gooberpatrol66 has joined #osdev
<heat> >ConsistencyManager
<heat> most definitely in his java era
<heat> TlbConsistencyManagerController
<geist> heh i actually didn't write the initial thing
<geist> but actually that design works great: at the top level when you start to drill into the mmu page table, pass a ref to this class which builds up alist of TLB things to do
<Mondenkind> AbstractTlbConsistencyManagerControllerFactoryBean
<geist> then RAII makes sure everything gets cleaned up on the way out
<heat> i have that yeah
<bslsk05> ​github.com: Onyx/kernel/arch/x86_64/mmu.cpp at master · heatd/Onyx · GitHub
<geist> there's a new thing someone else added recently that acts as a cursor for the page walker as it goes through the levels
<geist> and also cleans up some of the walking code and lets it pick up where it left off
<geist> heat: https://fuchsia-review.googlesource.com/c/fuchsia/+/1021452 was the DSB + ISB thing. i ended up adding some logic to the consistency manager that causes it to ISB on the way out if it fiddled with a kernel page
<bslsk05> ​fuchsia-review.googlesource.com <no title>
zetef_ has quit [Ping timeout: 268 seconds]
zetef has joined #osdev
<heat> >cpu cannot specualatively
<heat> literally unusable
<heat> Nacked-by: heat
<heat> couldn't you just take the spurious page fault?
<zid> heat are you specual
<heat> mommy always told me i was a specual boy
zetef has quit [Ping timeout: 256 seconds]
zetef_ has joined #osdev
<zid> I'm specular, personally
<zid> but I am hoping to become phong
<heat> are you gouraud or not even that
<zid> matte is for disgusting perverts
carbonfiber has quit [Quit: Connection closed for inactivity]
zetef_ has quit [Ping timeout: 240 seconds]
zetef has joined #osdev
gog has quit [Ping timeout: 264 seconds]
<geist> heat: no we completely dissalow kernel page faults
<geist> didn't want to go down that rabbit hole of making it sometimes okay, sometimes not, so it's just hard NAKed
<heat> huh okay
<heat> even for riscv?
<geist> why would riscv be different?
<heat> cuz of needing to shootdown tlbs after mapping a page
<geist> shootdown the tlb
<heat> like any page
<heat> that sounds pretty awful
<geist> there are lots of things in riscv that are pretty awful
<heat> correct, this is one of them
<heat> it is as one habitual pisstaker here would say "pessimal."
<geist> note we do take page faults whiule running kernel code, but only when handling faults within user_copy
<geist> but general page faults int he kernel, we actually have a panic in the PF handler
<geist> but it does mean break-before-make is particularly difficult to deal with
manawyrm has quit [Quit: Read error: 2.99792458 x 10^8 meters/second (Excessive speed of light)]
manawyrm has joined #osdev
zetef has quit [Ping timeout: 255 seconds]
zetef has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
masoudd_ is now known as masoudd
<mcrod> wow
<mcrod> for some strange reason, when using clang on mac, -Og totally trashes even the simplest ubsan output
zetef_ has joined #osdev
zetef has quit [Ping timeout: 260 seconds]
spare has quit [Remote host closed the connection]
<mcrod> well to be clear
<mcrod> it doesn't TRASH it
<mcrod> but you lose a lot of information
<zid> >strange reason >mac >clang >ubsan
<bslsk05> ​pastie.org: Pastie
Turn_Left has quit [Read error: Connection reset by peer]
zetef_ has quit [Ping timeout: 255 seconds]
zetef has joined #osdev
<mcrod> http://pastie.org/p/30Jc12jLV1S4JQu5T3dP0w for the simplest code
<bslsk05> ​pastie.org: Pastie
navi has quit [Quit: WeeChat 4.2.1]
netbsduser has quit [Ping timeout: 256 seconds]
Gooberpatrol66 has quit [Remote host closed the connection]
netbsduser has joined #osdev
<geist> mcrod: iirc, -Og isn't real on clang? i think it may just alias to -O1 or something
<mcrod> it is on modern versions now
<geist> we dont use it in fuchsia for that reason. are you sure it's real?
<mcrod> i'm sure
<geist> or more like the switch is implemented?
<geist> hmm, interesting
<geist> maybe we just dont use it because it's bad, as you found out :)
<mcrod> of course, google is failing me
<mcrod> well it also shits the bed on -O1
<mcrod> and the clang docs say -O1 is ok
<mcrod> -Og is -O1 minus some features that can kill debugging experience
<geist> see the thing is the real docs say something like 'in the future it may...'
<geist> https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-O0:~:text=%2DOg%20Like%20%2DO1.%20In%20future%20versions%2C%20this%20option%20might%20disable%20different%20optimizations%20in%20order%20to%20improve%20debuggability.
<bslsk05> ​clang.llvm.org: clang - the Clang C, C++, and Objective-C compiler — Clang 19.0.0git documentation
<geist> and that lines up pretty much with what the compiler folks at work are telling me
<mcrod> i swear to god
<mcrod> they implemented -Og to be closer to gcc -Og in later versions
<geist> sure, could be the docs are out of sync
<geist> i have no particular skin in this game
<mcrod> fair
<mcrod> but i'm bothered by the fact I can't find the post
<Mondenkind> i don't think -Og has ever done anything useful even in gcc
<Mondenkind> i mean like
<Mondenkind> i think there've been. a couple of occasions where it got rid of an <optimised out>? but broadly speaking i haven't found it to make a big difference
<mcrod> the manual says it's better than -O0
<mcrod> but that's what it *says*
<geist> i think in general not optimizing the flow of the code but removing all the extraneous stores to the stack would be a huge win
<mcrod> what it *does* is a different matter
<geist> and things like constant expression collapsing
<geist> -O0 is just so basic it's hard to use
<mcrod> i've had a time convincing one of the older embedded guys at work about code size with relation to gcc
<mcrod> you can't use -O0, to be clear
<mcrod> you have to use -Og or -O1
<geist> i think the idea is modern dwarf is pretty good at describing fairly complicated things, so just having to write everything on the stack is not really unnecessary
Gooberpatrol66 has joined #osdev
<geist> s/unnecessary/necessary
<Mondenkind> i mean i definitely think the debuggability:performance pareto frontier could be pushed way further
<Mondenkind> but gcc/llvm is bad at most things sooooo
zetef has quit [Remote host closed the connection]
goliath has quit [Quit: SIGSEGV]
<heat> mcrod: where's the bed shitting?
<mcrod> you must be blind
<mcrod> a whole bunch of information is clearly gone
<heat> the only difference is that ASAN isn't being triggered, because UBSAN already is
<heat> you know the null pointer was dereferenced
<heat> it *will* crash anyway
<mcrod> ok i guess
<heat> also omg mcrod question that doesn't involve psx emulator code and 3 layers of preprocessor macros