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
X-Scale has joined #osdev
wantyapps is now known as aplel
chibill has quit [Server closed connection]
memset has quit [Remote host closed the connection]
chibill has joined #osdev
memset has joined #osdev
X-Scale1 has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
karenthedorf has joined #osdev
memset has quit [Ping timeout: 260 seconds]
janemba has quit [Read error: Connection reset by peer]
gildasio has quit [Ping timeout: 260 seconds]
memset has joined #osdev
gildasio has joined #osdev
gog has quit [Quit: byee]
m3a has joined #osdev
janemba has joined #osdev
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
MiningMarsh has joined #osdev
MiningMarsh has quit [Ping timeout: 252 seconds]
aplel is now known as wantyapps
m3a has quit [Ping timeout: 244 seconds]
edr has quit [Quit: Leaving]
m3a has joined #osdev
MiningMarsh has joined #osdev
particleflux has quit [Server closed connection]
particleflux has joined #osdev
bradd has quit [Ping timeout: 264 seconds]
bradd has joined #osdev
Opus has quit [Server closed connection]
Opus has joined #osdev
heat has quit [Ping timeout: 248 seconds]
Apollyon has joined #osdev
Apollyon has quit [Ping timeout: 272 seconds]
bl4ckb0ne has quit [Server closed connection]
bl4ckb0ne has joined #osdev
zid has quit [Server closed connection]
zid has joined #osdev
memset has quit [Ping timeout: 260 seconds]
memset has joined #osdev
X-Scale1 has quit [Ping timeout: 256 seconds]
Matt|home has quit [Read error: Connection reset by peer]
netbsduser has joined #osdev
goliath has joined #osdev
netbsduser has quit [Ping timeout: 248 seconds]
eck has quit [Server closed connection]
eck has joined #osdev
runxiyu has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
remexre has quit [Server closed connection]
remexre has joined #osdev
bliminse has quit [Server closed connection]
bliminse has joined #osdev
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
runxiyu has joined #osdev
runxiyu has quit [Excess Flood]
runxiyu has joined #osdev
foudfou has quit [Remote host closed the connection]
memset has quit [Read error: Connection reset by peer]
gildasio has quit [Read error: Connection reset by peer]
memset has joined #osdev
gildasio has joined #osdev
foudfou has joined #osdev
nitrix has quit [Server closed connection]
nitrix has joined #osdev
tanto has quit [Server closed connection]
tanto has joined #osdev
vancz has quit [Server closed connection]
vancz has joined #osdev
pie_ has quit [Server closed connection]
pie_ has joined #osdev
obrien has joined #osdev
alexander has quit [Server closed connection]
alexander has joined #osdev
GeDaMo has joined #osdev
gildasio has quit [Remote host closed the connection]
memset has quit [Remote host closed the connection]
chiselfuse has quit [Remote host closed the connection]
memset has joined #osdev
gildasio has joined #osdev
chiselfuse has joined #osdev
cross has quit [Server closed connection]
cross has joined #osdev
PublicWiFi has quit [Server closed connection]
PublicWiFi has joined #osdev
elttil has quit [Server closed connection]
urandom__ has joined #osdev
Left_Turn has joined #osdev
exit70 has quit [Server closed connection]
exit70 has joined #osdev
scaleww has joined #osdev
navi has joined #osdev
theruran has quit [Quit: Connection closed for inactivity]
q3lont has joined #osdev
ZipCPU has quit [Server closed connection]
ZipCPU has joined #osdev
manawyrm has quit [Server closed connection]
manawyrm has joined #osdev
kpel has joined #osdev
X-Scale has joined #osdev
Gordinator has joined #osdev
ghostbuster has quit [Server closed connection]
ghostbuster has joined #osdev
kpel has left #osdev [Leaving]
qookie has quit [Server closed connection]
X-Scale has quit [Ping timeout: 256 seconds]
Starfoxxes has joined #osdev
whereiseveryone has quit [Server closed connection]
whereiseveryone has joined #osdev
X-Scale has joined #osdev
qookie has joined #osdev
q3lont has quit [Quit: Leaving]
jeaye has quit [Server closed connection]
jeaye has joined #osdev
<adder> anyone use limine?
bauen1 has quit [Ping timeout: 244 seconds]
jleightcap has quit [Server closed connection]
<adder> I'm not sure what physical address should I start mapping things from, that is, what should be my first free page
jleightcap has joined #osdev
<adder> if I set it to hhdm_offset, then when I need to get physical address of pml4, when I subtract the offset, it ends up 0
<bslsk05> ​bpa.st: View paste OJWQ
<adder> I'm trying to recreate limine's virtual memory mappings btw
<adder> that is, just set up my own page tables, identical
<nikolar> Why not just use limine
<adder> I am using limine nikolar :)
<nikolar> So what do you mean by recreating their mappings
<adder> like setting up my own page tables
<zid> nikolapdp why not just use limine
<adder> default response on discord
<adder> just use limine bro
obrien has quit [Remote host closed the connection]
<nikolar> well it's pretty pointless writing 16 and 32bit code just to bootstrap long mode
<nikolar> Thus, use limine
<nikolar> Ie, let someone else do that
<adder> actually it's quite educational, but yeah I ended up using limine
<adder> if I manage to get it working, that is
<nikolar> It was pretty easy when I did it
<adder> anyway, wtf should my free_page be
<nikolar> free_page?
<adder> yeah the physical address of the first available page
<adder> ...frame, I think
<klys_> good options start at 0x100000 (1MB) with x86
<nikolar> Wasn't there a limitation that dma can only use the first 16mb of physical memory
<zid> for.. ISA
<zid> nikolapdp: have you considered limine?
<nikolar> zid i forgor :|
<zid> is limine limeen or li mine btw
sjs has quit [Server closed connection]
<zid> limmy né
sjs has joined #osdev
<nikolar> Lee-mee-neh I think
<nikolar> I think it's supposed to be Italian
<zid> oh god
<zid> or japanese I guess?
<nikolar> Probably not
<zid> I found an american saying it as part of a latin law phrase
<zid> lim-i-neh was right yea
<nikolar> Yeah I was just about to say that
<zid> but the neh is a soft ehhh not a é
<nikolar> So if latin then definitely Lee-mee-neh
<bslsk05> ​limine-bootloader.org: Limine
<zid> so you can install it, or read the source
<zid> but you can't find out anything about how to install or use it
<nikolar> It tells you it's using its own protocol and links to it though
<nikolar> In the readme
<zid> https://github.com/limine-bootloader/limine better than their actual website
<bslsk05> ​limine-bootloader/limine - Modern, advanced, portable, multiprotocol bootloader and boot manager. (135 forks/1705 stargazers/BSD-2-Clause)
<nikolar> Indeed
<zid> interesting, it enables the pml5 by default
<zid> I'm not sure how I feel about that
<zid> I'd think a pml5 unaware kernel is just going to explode on that, the first time it tries to swap cr4?
<nikolar> If you're using limine, you should know to request pml4 instead
<nikolar> zid
<nikolar> > The default mode (when this request is not provided) is LIMINE_PAGING_MODE_X86_64_4LVL
<zid> oh right I misread
<zid> I was just skimming and looking at the quoted bits in the brackets, oopsie
<zid> "PG is enabled (cr0), PE is enabled (cr0), PAE is enabled (cr4), WP is enabled (cr0),"
<zid> "...(LA57 bit in cr4)."
<zid> Turns out inside the ... there's some text about it being optional, who knew
<nikolar> Lel
<zid> I meant cr2 I think also
<nikolar> Got it
X-Scale has quit [Ping timeout: 256 seconds]
obrien has joined #osdev
puck has quit [Server closed connection]
puck has joined #osdev
FreeFull has quit [Server closed connection]
FreeFull has joined #osdev
X-Scale has joined #osdev
skipwich has quit [Server closed connection]
bauen1 has joined #osdev
skipwich has joined #osdev
Reinhilde has quit [Server closed connection]
Ellenor has joined #osdev
heat has joined #osdev
gildasio has quit [Ping timeout: 260 seconds]
gildasio has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
MrCryo has joined #osdev
<dostoyevsky2> Does minix play the role of Grub here when booting this 16bit linux? https://www.youtube.com/watch?v=6rwlqmdebxk&t=48
<bslsk05> ​'booting ELKS on an old 286 MB from 1,44MB floppy' by rayer314 (00:03:11)
Terlisimo has quit [Server closed connection]
Terlisimo has joined #osdev
memset has quit [Remote host closed the connection]
memset has joined #osdev
<nortti> I don't think so, I believe it's the minix (filesystem?) bootloader: https://github.com/ghaerr/elks/blob/master/bootblocks/boot_minix.c
<bslsk05> ​github.com: elks/bootblocks/boot_minix.c at master · ghaerr/elks · GitHub
scaleww has quit [Quit: Leaving]
obrien has quit [Remote host closed the connection]
MrCryo has quit [Quit: MrCryo]
josuedhg has joined #osdev
j00ru has quit [Server closed connection]
goliath has quit [Quit: SIGSEGV]
j00ru has joined #osdev
mahk has quit [Server closed connection]
<Ermine> You can use dos to boot linux
mahk has joined #osdev
<clever> Ermine: yep, bootlin
Ellenor is now known as Reinhilde
<Ermine> Old minixen worked in real mode afaik so they can be used to boot linux I guess
wgrant has quit [Server closed connection]
wgrant has joined #osdev
asarandi has quit [Server closed connection]
Affliction has quit [*.net *.split]
asarandi has joined #osdev
Affliction has joined #osdev
Affliction has quit [Max SendQ exceeded]
Affliction has joined #osdev
<adder> my kernel gets stuck when I attempt to reload CR3
<adder> I'm disassembling RIP in qemu and the line that comes out is mov %rax, %cr3
<adder> info registers: RAX=07ff80000004e000
<adder> I'm passing (uintptr_t)(pml4 - hhdm_offset)
<adder> I'm also trying to save the phys addr when instantiating pml4 for the first time and then pass that but no luck
<adder> hm, scrap that
mavhq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
smeso has quit [Server closed connection]
smeso has joined #osdev
<adder> I end up with just one mapping :(
frkazoid333 has quit [Ping timeout: 260 seconds]
mavhq has joined #osdev
<mjg> - ATF_REQUIRE(st.st_mode = 0600);
<mjg> + ATF_REQUIRE(st.st_mode == 0600);
<mjg> noice
bauen1 has quit [Ping timeout: 252 seconds]
<heat> mjg, mofer does fbsd have their own fs testing thingy? have they tried xfstests?
<mjg> there is a bunch of crap like fsx
<mjg> i don't know if xfstests specifically were ported
<mjg> i would assume so
<Ermine> s/mofer/mon/
<heat> i kinda need xfstests but i'm missing umount
<heat> and that would require some effort
npc has joined #osdev
<mjg> lol
<mjg> you are the hello world kind of guy aren't you
<heat> what
frkzoid has joined #osdev
<Ermine> I'm the hello world guy here
<heat> sometimes mjg shits on onyx like it's a real system and i'm always conflicted between being offended or being proud of building such a notable thing myself
tomaw has quit [Read error: Connection reset by peer]
<mjg> i'm shitting on it while taking into account 1. this is a one-person project 2. you claim you take it seriously
<mjg> to that end, i don't expect you are going to get a xfs or zfs port
<mjg> i do expect you are going to have a working umount (LOL)
<mjg> maybe you are inhabited by a spirit of some early days unix geezer
xenos1984 has quit [Read error: Connection reset by peer]
<mjg> these dudes had swap configured by hardcoding shit in the kernel
<mjg> did not have a syscall for halting the box
<mjg> so what's umount even
<mjg> are you retyping shit you got from ouija board?
tomaw_ has joined #osdev
<heat> not sure if there's a single hobby OS with umount
tomaw_ is now known as tomaw
<heat> >i don't expect you are going to get a xfs or zfs port
<heat> sounds ez to me
<heat> porting zfs would probably be a solid testament to my vfs but otoh i dont want to mess with the whole opensolaris deal
<mjg> let me guess
<mjg> having umount automatically means it's not hobby?
<mjg> my impression was that you are larping onyx being a real system
<mjg> with time constraints taken itno account
<heat> umount is a functional edge case that isn't really important in the grand scheme of things
<heat> that's why it's commonly missing
<mjg> i agree run of the mill hobby os probably should not care
<mjg> but then again people who write that don't larp it being a real thing
<mjg> just have something they wanted to do
<mjg> perhaps you can explain your idea of taking the os seriously in a hobby setting
<heat> i try my hardest to make a technically sound system
<heat> even though if anyone's running it in prod LOL PLEASE STOP
<heat> i do want umount and remounting and all that shit, as much as i want hugepages and yadda yadda, but my time is finite and i have to focus to on certain things
<heat> it is that umount and remounting and a revamp of that bit of the kernel was in order, so i'm probably working on it soon
<heat> now if your point is that when i say i "larp linux" i actually mean you should replace all instances of linux with my very serious contender, well, that's just wrong
<heat> larping implies some shitty immitation of whatever it is you're larping
<mjg> i don't see how one can get that idea given
<mjg> 18:54 < mjg> i'm shitting on it while taking into account 1. this is a one-person project 2. you claim you take it seriously
<mjg> so i very much expect you to stick to a lulfs
<mjg> also meaning this is not usable in actual real-world setting
<heat> it's totally usable in simple cases
* mjg burps
<heat> but if you're expecting it to be google's backbone, well, probably not
xenos1984 has joined #osdev
<mjg> which part of the following sentence you don't understand:
<mjg> 19:11 < mjg> 18:54 < mjg> i'm shitting on it while taking into account 1. this is a one-person project 2. you claim you take it seriously
<mjg> i just noticed i'm missing a 'to' here, maybe that's resulting in confusion
<heat> >but my time is finite and i have to focus to on certain things
<mjg> but in that spirit, do you think adding umount is what qualifies the os for google backbone?
<heat> no, but it definitely helps
<heat> given what e.g containers do with filesystems and mounts
<mjg> 's fine with me, just you are flip flopping between defending not having umount on basis "what for" and claiming it's a matter of priorities
<mjg> i see a lot of ground between "usable at google" and onyx + umount and onyx
<mjg> you know
<heat> i didn't say what for, i always said it's a matter of priorities
<heat> which is why most hobby osen don't have it
<mjg> you gave me bullshit about hobby os not having umount
<mjg> which in this context is not relevant
<mjg> anyhow, this convo is really not getting anywhere, is it
<mjg> so tell you what
<mjg> you get vnode recycling goin'
<mjg> and i'm gonna test it
<mjg> how is that
<heat> in any case onyx with umount is probably usable for oracle's backbone
<heat> call me larry we'll settle some things
<mjg> larry said he is rolling out sortix
<heat> i would love to get inode recycling but my dcache is leaking refs and i don't know where
<heat> but it ends up actually leaking filesystem inodes cuz they never get reaped by the fs code, yay
<mjg> could unmount support help debug that
<mjg> :thinkingface:
<heat> yeah if xfs found it
<heat> xfstests i mean
<mjg> so i just pulled on onux and see the zero page stuff
<mjg> you are going all linux
<heat> what zero page stuff?
<mjg> anon: Flush the TLB when mapping over zero pages
<heat> other systems don't do zero pages?
<mjg> bsds and solaris don't
<heat> i thought it was pretty standard
<mjg> no it's a linuxism as far as i know
mavhq_ has joined #osdev
<mjg> ey heat, can you give me an operational onyx image with will-it-scale?
<heat> i think geist has mentioned fuchsia does it and they also scan committed pages for all-0s and replace them with zero pages
<heat> l8er, aight?
<mjg> so happens i'm looking at pipes in freebsd and they suck terribly
<mjg> it is plausible onyx is faster(!)
<mjg> i'm in no rush, just sayin'
<heat> my pipes are pretty simple
mavhq has quit [Ping timeout: 244 seconds]
<mjg> the bsds have a sleepable lock inducing more on/off cpu cycles than necessary when pushing data
<mjg> i verified perf sucks hardcore compared to linux
<heat> i also have a mutex
<mjg> i suspect you have a spinning lock there, in which case it should also suck compared to onyx
<heat> but it spinz
<mjg> right
<mjg> so i expect onyx to do better on these grounds
<mjg> don't you want to know if you do something legitimate better
<mjg> apart from being funny, it's not something i'm going to suffer
<heat> it might yeah
<Ermine> mjg: you can write "optimization for dummies" book
<heat> whatever the fuck vmalloc is doing seems really... odd
<heat> i've seen on /proc/vmallocinfo like ~2300 unpurged vm_areas, each 5 or 6 pagen long
<heat> looks like a dramatic waste of page tablen to me
<dostoyevsky2> > hating on rust is so hot right now
gog has joined #osdev
<mjg> Ermine: 1. don't PESSIMAL 2. the end
<Ermine> I haven't seen any hot rust haters
<Ermine> mjg: don't PESSIMAL is easier said than done
<dostoyevsky2> Ermine: I wanted to say something but then I forgot as I was too busy hating rust
<mjg> Ermine: step 0. is FUCKING PROFILE
<mjg> Ermine: a real workload
<Ermine> and then
<mjg> then break it down into smaller parts you can ubench
<mjg> to get better visibility
<heat> Ermine, find me a hot C programmer
<heat> that's not named bryan cantrill
<Ermine> I believe openbsd and freebsd people know what is profiling
<mjg> here is an easier guide by Geezer McUnix
<mjg> just claim it's all i/o
<Ermine> heat: bryan is rust guy isn't he
<heat> historically a C programmer
<mjg> openbsd know about profiling about as much as they do about security, to my understanding anyway
<heat> i don't think he writes code anymore
<geist> heat: yeah re: scanning for zeros, though that's generally replaced now by a zram style compressor
<heat> oooh fancy
<geist> the page compressor detects zeros while it's at it and dedups it
<mjg> what kind of stats are you getting on this?
<geist> zeros? lots, annoyingly. user space software sucks
<geist> they're always allocating some large ass thing and zeroing it out and then not touching it
<mjg> that i know, but liek what's the reality there
<Ermine> heat: gotta admit poeterring is hot
<mjg> oh ye the memset(buf, 0, GIGANTISH) before memcpy
<mjg> classic
<geist> enough that it shows up
<mjg> wait that's in fuchsia?
<geist> and for this particular use case it's all about running in low memory situations
<mjg> so that's yoru own software fucking up like that?
<geist> no swap, not a lot of ram, etc
<geist> some our own, some not
<mjg> i know rust coerces people into zeroing when they don't need to
<geist> exactly, rust is a big offender
<mjg> system's language right there
<geist> and in general 'safe' c++ is too, since the google style guide, etc has rules about always zeroing everything, etc
<mjg> have you tried looking at total thread counts?
<mjg> because based on what i had seen up to this point i also expect you get plenty of avoidable threads
<geist> probably
<mjg> speaking of lowmem 'n shit
<geist> keep in mind it's a microkernel, so lots of threads is sort of par the course
<mjg> certainly
<mjg> i'm saying the rustards like to "thread pool" a lot
<mjg> and by thread pool they just spawn n threads cause why not
<geist> a few hundred processes, probably 5-10 threads a piece, etc
<geist> easily over 1k threads
<mjg> multiply that fuckton of procs spawned and you get a disaster
<mjg> there is the idea that spawned threads are cheap
<geist> well we tune everything for that
<heat> C++ does that unavoidably
<heat> also never forget CHROMIUM is also fuchsia software
<mjg> i firefox, no that it acts sane
<mjg> not*
<geist> yep. that's i think one of the biggest offenders, and largely a black box
<Ermine> does it fuck up threading
<heat> i meant re: memset over allocated memory
<geist> but it's not really that much of a problem, mind you. we're paid to make things work, so we make it work
<mjg> kind of a sellout mentality mon
<mjg> to not even bitch about it :-P
<geist> yah a general idiom everywhere is foo bar = {}; for structs, etc
<mjg> you would think rust with all its strictness would precisely be the lang to NOT need this
<geist> mjg: sure, but it's a little different when you're on a team and paid for it. if you bitch about it constantly no one listens to yo uanymore
<Ermine> vulkan tutorial i'm following does VkLol lol{};
<geist> the best way to get your voice heard is pick your battles, and dont turn into a negative nancy
<heat> good
<mjg> meanwhile even the internals love to zero to shut up the compiler
<geist> but actually that's a really gnarly feature we have enabled in the compiler: tell it to fill all locals with garbage
<geist> it finds bugs, but it's so much extra work
<mjg> hm
<mjg> is that really helpful tho?
<heat> yep
<mjg> do you have asan et al?
<geist> occasionally, yes
<mjg> i would epxect that to sort things out
<geist> though i have to admit we haven't found much in the kernel with it
<geist> we do
<Ermine> how to enable this feature?
<heat> bugfree MINIMAL microkernel vs bugfull SHIT BLOATED monolithic kernel
<geist> hmm, i forget the switch. it's a clang feature
<geist> look for something like 'fill' etc
<mjg> well i don't get it -- what does it find that (k)asan does not?
<geist> it's cheap to run all the time, whereas kasan is not
<mjg> cause if it is worthwhile i'll try it ou on my product
<mjg> oh you always run it?
<geist> yes
<mjg> ok that's different
<mjg> i assumed something strictly for a test farm
<geist> there's a performance hit for sure. but i think the general idea is it's acceptable
<mjg> defo to ponder
<mjg> well i presume you are operating with some specified budget
<mjg> as opposed to "as fast as possible"
<geist> and yo ucan individually override it, fwiw. some some of the core data structures we have tagged with the attribute to disable
<geist> right
<geist> one thing it does that you can't eaisly do any other way is it also zeros out paddings within structures and objects
<geist> since you otherwise can't easily get to that stuff
<geist> again, i find the whole thing pretty dubious but the security folks are very keen on that sort of thing
<geist> so it's a give and take
<mjg> dude
<mjg> security folk are only take
<mjg> and lie while doing it
<Ermine> is that filling thing enabled at compile time
<geist> right, so you have to achieve a balance
<Ermine> ?
<geist> Ermine: yes
<geist> it generates extra code to fill stuff on creation
<mjg> fwiw linux likes to be built with zeroing registers
<mjg> i mean vars
<geist> zeroing registers i think we also enabled too
<geist> there's a security switch to zero registers before exiting a function that i think we have on on debug builds
<mjg> that one comes with a huge turd in gcc tho
<geist> really the big one we have is secure stacks (on x86) and shadow call stacks (on arm)
<mjg> say you have void func(...., bool loflag) { char buf[GIGANTISH]; if (!lolflag) return; .... }
<geist> that's honestly the big one, personally i think if you have that on the other ones are much less interesting
<mjg> it's going to emit zeroing the buf
<mjg> even for the immediate return case
<heat> -ftrivial-auto-var-init=zero mons
<geist> ah yeah. you can also tell it to zero init with something like 0xaaaaaa iirc
<geist> fill values that end up with a non canonical value i've found to be pretty great
<heat> yes
<heat> but =zero is supposed to be prod-ready
<heat> its safer than making it crash
<mjg> there isa funny story in openbsd
<mjg> they had the same poison value for years they would init stuff by hand with
<mjg> then they flipped bits the other way and found more bugs
<mjg> :d
<mjg> not surprising, but funny
<geist> hah. a thing we generally picked up from my code (was kinda new to google) was to add magic values to a lot of stuff
<geist> and honestly i think that finds more use-after-frees than anything else i've seen
<geist> or general corruption
<Ermine> crash > doing shit
<heat> uefi is high on magic values too
<mjg> in the entire ordeal i would be worried about reproducibility of builds though
<geist> it's pretty good about finding dma corruption and general hardware instability
<geist> we find that surprisingly large amount of time. if you are running hundreds or thousands of machines running unit tests you'll start to see patterns
<geist> heck we even found a ARM machine a few years back in our test fleet that literally had a broken floating point unit
<geist> would generate bad vectors and we'd see it in a unit test, on that one machine
<mjg> :p
<mjg> hardware was a mistake mon
<geist> but what happens is the kernel tends to be the canary, since the debug builds have a crapton of assserts and internal checks
<geist> tends to be the thing that stubs its toe first
<geist> or stray DMAs over the kernel
<geist> not having ECC is a mistake, full stop
<geist> but alas.
<geist> 9/10 times a hardware failure in the test fleet is bad ram
<Ermine> should i buy ecc memory for desktop
<geist> well, a) you need a desktop machine that can do it (AMD machines can, intels probably no, screw intel)
<geist> b) it'll be probably 2x the price
<geist> c) you'll lose a little bit of performance
<mjg> 2x the price, 0.999999x the crashes
<geist> for a server, 100%. for a file server? 100%
<geist> well, crashes is fine. corruption is what i care about
<mjg> your storage is of more concern in a desktop
<geist> i dont want it silently corrupting things
<mjg> ye i agree, things are not good here
<geist> which i had, years ago. a file server that silently corrupted my shit (a bunch of mp3s at the time)
<mjg> well that was not necessarily ram
<geist> mp3 corruption is annoying since it can take a while to notice it
bauen1 has joined #osdev
<mjg> storage going bad is pretty standard
<geist> it was 100% ram because once i noticed corruption (via md5 summing stuff) i did a ram test and it was hella broken
<mjg> which is what i was after in the above comment
<mjg> so for example zfs checksums stuff and has copies specifically to combat shite storage
<geist> you could md5 sum the same file, entirely in the file cache and it would get a different answer
<geist> yep, that would help a lot now. this was like 20 years ago
<mjg> i think this is when zfs got the feature mon :D
<geist> 20 years ago you'd have to run SOLARIS
<mjg> albeit at the time you probably had to be on solaris
<geist> to get zfs
<acidx> I'd take corrupted mp3s over running 20 year old solaris
<geist> bbiab. gotta go. boat docking
<mjg> well a production-quality freebsd port was not far off from that timeline mon
Gordinator has quit [Quit: My client has closed - perhaps I did that, perhaps I didn't]
<heat> CHECKSUMS BABY
<heat> WOOOO
<mjg> checksummen == good
<kof673> https://0x0.st/s/5vA6EAnyt-hTxnKE5Qje4Q/X9Qm.c untested, incomplete, probably full of bugs, but i am attempting "portable" md5 code, with a base type of 8, 9, 16, 32, 36, or 48 bits, in case you don't have a 32-bit type :D
<mjg> portable to what
<mjg> discord?
<kof673> "in case you don't have a 32-bit type" lol
<mjg> ah the configure spirit
<kof673> i think i've seen a 16-bit before, but not sure of licensing, i am using john walker "public domain" version in C
<kof673> the 48-bit trickiness, is the 56030 dsp, 24-bit char/short/int, 48-bit long (and long long, but identical)....so it needs some reworking for that. the others, can just simulate 32-bit stuff, and pdp-10 gcc i believe the 36-bit type can be accessed as 4x 9-bit uchars
<kof673> so that is really the only outlier IMO
<heat> jesus
<heat> that's terrible
<kof673> lol
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
<heat> also wtf is wrong with your ->
<kof673> too any parens or spacing?
<kof673> *many
<kof673> 36-bit should be identical to 32...just clamp to 32 for safety where needed i believe
<kof673> i avoid memset(0) at the end, because strictly i am not sure you are guaranteed to be able to do that, but not sure i have ever seen such a platform...the indentation funniness at the end
<heat> the too many parens is weird but i get it
<heat> the ptr -> member thing is terrible though, congrats
MiningMarsh has joined #osdev
netbsduser has joined #osdev
rom4ik has quit [Quit: bye]
rom4ik1 has joined #osdev
eck has quit [Quit: PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)]
eck has joined #osdev
<Ermine> heat: are there any specific complexities in implementing SCM_RIGHTS over datagram sockets?
<kof673> i did find one interesting post, but did not save
<kof673> basically was claiming "K&R 2" ...void * could hold "any pointer" including function pointers. but this was changed at the insistence of one vendor/compiler-writer, to create separate data/function pointers. but they ended up fixing their compiler anyways. his reasoning was void * 1) cannot be dereferenced anyway, without casting first 2) can just be large enough to hold either data or function pointer, if they differ
<kof673> that was how he read the standards anyways "any pointer" he included void * cast to/from function pointers
<kof673> 1) differs from how char * was being used prior. so he was arguing that is what void * was supposed to be, or how he thought it should be, but one single vendor lobbied otherwise, even though they later fixed their compiler.
<kof673> there would still be separate data and function pointers, but void * could hold either
<kof673> posix of course mandates same size IIRC...so you can say this happened "in practice" anyways, but it could've been guaranteed rather than "extensions" to standards or in posix case, a subset
rom4ik1 has quit [Quit: bye]
rom4ik1 has joined #osdev
getz has quit [Changing host]
getz has joined #osdev
<kof673> "spot the bug" the 8-bit/9-bit cases should not be shifting by 13 lol those are just for completeness but :D
rom4ik1 has quit [Quit: bye]
<netbsduser> Ermine: i think most implementations of right passing include a tracing GC
<Ermine> netbsduser: that's for both stream and datagram sockets, I'm asking for stuff which is dgram-specific
<Ermine> Heard that it's broken in freebsd
<netbsduser> it's different in freebsd
<netbsduser> i had to deal with this for systemd
<netbsduser> i forgot the exact details
rom4ik1 has joined #osdev
<netbsduser> but it (together with SCM_CREDS/SCM_CREDENTIALS) differs subtly between freebsd and linux
<netbsduser> expect special fun with MSG_PEEK
stilicho has joined #osdev
rom4ik1 has quit [Quit: bye]
rom4ik1 has joined #osdev
<chiselfuse> is dtrace useful/used much nowadays?
<mjg> on linux no
<chiselfuse> mjg: what compensates on linux then?
<mjg> ebpf
bauen1 has quit [Ping timeout: 265 seconds]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
stilicho has quit [Quit: Client closed]
memset has quit [Remote host closed the connection]
memset has joined #osdev
navi has quit [Quit: WeeChat 4.2.3]
netbsduser has quit [Ping timeout: 244 seconds]
Starfoxxes has quit [Read error: Connection reset by peer]
netbsduser has joined #osdev
cow321 has quit [Remote host closed the connection]
cow321 has joined #osdev
memset has quit [Remote host closed the connection]
memset has joined #osdev
memset has quit [Remote host closed the connection]
memset has joined #osdev
<heat> Ermine, i don't think so
<heat> but tbqh i dunno
<heat> i'm not a SCM_RIGHTS specialist, and this is all COMPLETELY UNDOCUMENTED IN POSIX
<heat> POSIX THE GREAT STANDARD THAT DOES NOT DOCUMENT IMPORTANT STUFF
<Ermine> yeah, posix, you had one job
<heat> they basically say "SCM_RIGHTS lets you pass fds, here's the struct" and boom, nothing else
<heat> MSG_PEEK behavior? nope, not specified!
bauen1 has joined #osdev
<sortie> heat: It doesn't even say that much
<sortie> It says SCM_RIGHTS exists and does something like that, it doesn't even mention fds, or not to use it, or that you pass ints, or what not
<sortie> It's a bit wild whenever POSIX tries to standardize something as a stub that you cannot use, like ioctl or posix_devctl
<heat> ioctl was entirely defined for the best feature ever, STREAMS
<Ermine> do streamers use STREAMS
<nikolar> STREAMS
X-Scale has joined #osdev
<Ermine> what is even posix_devctl
<heat> it's a new made up ioctl
<heat> that *no one* implements
<Ermine> google gives links to qnx docs
<Ermine> but those redirect to their home page
<Ermine> posix, you had one job [2]
<heat> posix is the US congress of operating systems
<heat> in that they pretend to work but don't actually do anything of note
goliath has joined #osdev
<heat> sorry, pthreads were okay, posix_spawn ended up being /okay/ too
<Ermine> another day, another pipewire issues
<heat> classic
<heat> if i had to jump on a voice call without issues speaking or sharing my screen, i'd think i accidentally booted into windows
<Ermine> or it is a miracle
<heat> RING THE CHURCH BELL
<Ermine> not so long ago zoom just crashed when I tried to share my screen in sway
xenos1984 has quit [Read error: Connection reset by peer]
<heat> THE YEAR OF THE LINUX DESKTOP IS UPON US
<Ermine> that's why I have x11 plasma as a backup desktop
memset has quit [Remote host closed the connection]
memset has joined #osdev
<Ermine> minimalism luller moment, rofi crashes ocassionally
<karenthedorf> When writing x64 interrupt handlers: Am I right in thinking that on entry, the stack is normally misaligned, unless an error code has been pushed? Hardware aligns to 16 bytes, the pushes 5(no error code) or 6(error code) 64-bit words?
<karenthedorf> I then push 9 registers (The SYS-V ABI caller saved registers), which realigns the stack in the non-ec case but misaligns it in the ec-case? So I should add 0x8,%rsp when there's an error code?
<karenthedorf> I'm confused because I was starting from copying what clang does with __attribute__((interrupt)), but it seems to do 2 extra 64-bit pushes in the ec case, which is non-sensical.
vdamewood has joined #osdev
<karenthedorf> gcc does what I just described.
xenos1984 has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
<gog> karenthedorf: generally most ISRs will push for the non-ec case
gildasio1 has joined #osdev
gildasio has quit [Remote host closed the connection]
<bslsk05> ​github.com: sophia/kc/core/cpu/exceptions.S at main · adachristine/sophia · GitHub
<gog> line 27
<gog> or rather, line 4 begins the macro, like 27 begins the condition applied to the macro
<karenthedorf> gog: Yeah, other than a few specific ones with vectors <32
<karenthedorf> But those are some pretty critical ones like #PF
<gog> my macros cover all current cases
<gog> i think
<gog> but i only actually define bodies for #PF and #GP
<karenthedorf> gog: https://pastebin.com/WedtWhNN This is what I've ended up with. Seems to align the stack correctly if I intentionally take a page fault. (I wwill probabally need to pass the address of the stack frame to C eventually, right now just pass the vector and error code)
<bslsk05> ​pastebin.com: .macro common_interrupt_stubpush %r11push %r10push %r9push %r8 - Pastebin.com
<gog> that's a workable approach too, but for me i pass the entire stack frame as a parameter to the C code
<gog> so it always has to be the same size
<gog> interrupts and exceptions are convenient times to do context switches
* vdamewood inserts a fish into gog's interrupt handler
<karenthedorf> Yeah I could have INTERRUPT_STUB push 16 bytes. Or have EXCEPTION_STUB pass 16 above the stack pointer.
* gog vectors to fishy
<karenthedorf> Depending if I want the EC in the stack frame or passed separately
SGautam has joined #osdev
<gog> yeah that's essentially the same approach as me, only two different macros instead of one with conditionals
josuedhg has quit [Quit: Client closed]
josuedhg has joined #osdev
<heat> karenthedorf, push a dummy error code
<heat> and keep it in the stack
<karenthedorf> That's probabally the better way yeah.
<heat> then it's ez to handle any case, no ifs buts and maybes
antranigv has quit [Ping timeout: 272 seconds]
netbsduser has quit [Ping timeout: 260 seconds]
npc has quit [Remote host closed the connection]
<karenthedorf> Yep, that means I no longer need any postscript in the stub. (optional: pushq $0), push rdi, mov $idx,rdi, jmp common_stub is all it needs.
<heat> add $8, %rsp; you don't actually need to store :)
<karenthedorf> Well... current implementation of my interrupt handler ust prints the interrupt number and the error code (if it's non-zero). So right now I do. In future no.
<heat> aight
<heat> also i meant sub, not add :)
<karenthedorf> Also gcc and clang both prefer `push %rax` over `sub $8,%rsp` as it's a smaller instruction. Not sure that applies to immediates.
<heat> gcc and clang prefer weird stuff sometimes
<heat> it *might* be that it's 0.01% faster, i dunno i'm not a compiler :)
<vdamewood> lea for math, anyone?
<bslsk05> ​developer.nvidia.com: NVIDIA Transitions Fully Towards Open-Source GPU Kernel Modules | NVIDIA Technical Blog
<puck> s/Open.*/Female/bs
<puck> oh right wrong channel
<puck> ignore my shitposting
<heat> what
<heat> explain!
<puck> anyways, i'm a bit sad that this requires the nvidia open driver still, rather than nouveau
<heat> ohhhhhhhhhhhhh i get the joke now haha
<heat> well nouveau was never an option
<heat> this driver needs to work on linux and windows and mac and freebsd and whatever
<Ermine> nova is on the way
<vdamewood> Yum, FreeBSD.
<mcrod> hi
* vdamewood licks FreeeBSD.
<heat> writing two drivers for their GPUs is futile and only something some really big company like Intel could do
<mcrod> oh my god
<mcrod> NVIDIA is embracing open sauce?
<Ermine> nvidia is big isn't it
<heat> yeah they're taking their open-source hormones
<puck> heat: does cuda? :p
<vdamewood> Ermine: Msybe a little
<mcrod> i don’t believe it
<heat> intel is way bigger than nvidia
<mcrod> if you’d say this would happen 10 years ago i’d throw you out the window
<heat> intel does fucking everything at the same time
<mcrod> intel sucks
<mcrod> you also suck
<Ermine> mcrod: don't hold your breath, userspace part is still closed source
<heat> fuck you mike
<mcrod> fuck you pedro
<mcrod> Ermine: oh
<mcrod> well, progress
<Ermine> heat: there just was a discussion on #nouveau , and devs say that nvidia kernel driver doesn't maintain stable uapi
<heat> is nouveau still a trashfire or did they get their things together?
<Ermine> they do new driver, in rust
<heat> i know, my nvidia modules spam my dmesg when i update the nvidia-utils package
<mcrod> nouveau sucks
<heat> a whole new driver? kernel driver?
<Ermine> yes
<mcrod> they can’t even get their current one right
<mcrod> and that’s not because of language
<Ermine> it's called nova
<sauce> so i take it this is not going to be mainlined
<heat> this = what?
<sauce> nvidia's foss drivers
<heat> ofc not
<bslsk05> ​gitlab.freedesktop.org: drivers/gpu/drm/nova · nova · drm / nova · GitLab
<mcrod> why wouldn’t they be mainlined?
<Ermine> 3 months ago though
<Griwes> heat, they are still a trash fire, though they get fed more information from us these days than until recently, so maybe it'll get better
<heat> mcrod, there's a whole API wrapper layer around nvidia.ko
<heat> because they do share this driver between systems
<heat> mainlining (making it "linux-pure") would be anti-business
<mcrod> ah
<Griwes> I've heard whispers of maybe landing something, just not in /drm/
<Ermine> amd shares stuff between systems as well, doesn't it
<heat> probably not
LambdaComplex has quit [Server closed connection]
<heat> considering radeon and amdgpu are different drivers
<Griwes> the windows graphics layer is its own beast that needs its own special treatment
<Ermine> that's what they said me in some issue
<Griwes> so there's already a whole bunch of stuff that's not shared
<heat> intel literally develops two completely separate drivers with two separate teams with no shared knowledge between
<Griwes> and a huge portion of the shared code has been pushed into the firmware on the gsp
<Ermine> that explains why intel windows drivers work better than linux ones
<heat> do they?
<karenthedorf> If it's anything like AMD, nouveau will continue to exist, poorly maintained, in "legacy hardware" mode until it dies of bitrot.
<guideX> do you guys find it tough to find time to work on your os, I find myself working on it in the wee hours of the morning, I have these bags under my eyes lately xD
* karenthedorf types this from a laptop that's too old for working AMDGPU support
<karenthedorf> And the last fglrx release was over a decade ago.
<Ermine> heat: I feel that yes
<puck> mind you, the nouveau driver runs at full speed under modern GPUs (GSP, same as the open nvidia driver)
<puck> (afaict)
<heat> nouveau driver running at full speed must be like a scooter at full speed
goliath has quit [Quit: SIGSEGV]
<mcrod> can confirm nouveau is garbage on my 3090ti
<mcrod> not using the proprietary drivers might as well be death
<mcrod> i don’t even know why they bother
<mcrod> nouveau has been around since forever and it’s nowhere close to decent usability
<Ermine> did you try with nvk_zink?
<Ermine> nvk+zink i mean
<mcrod> no
phr3ak has quit [Server closed connection]
phr3ak has joined #osdev
<mcrod> that sounds like it would be more trouble than it’s worth
<heat> you don't get it mcrod
<heat> you get to be the beta tester for a 3D driver
<heat> it's gr8
<heat> don't worry this one is written in rust
<Ermine> well I just was genuinely curious
<Ermine> I can't test since I don't have nvidia hardware
<heat> it's possible it might help, it's possible it might crash
<heat> oh wait it can't crash, it's rust
<heat> it'll just panic!()
<Ermine> it panics instead
<heat> .unwrap()
memset has quit [Ping timeout: 260 seconds]
<Ermine> did I say that Karol Herbst is rust fan apparently?
<heat> it's pretty clear he's a rust fan yeah
<mcrod> who the fuck is that
<heat> main guy behind nouveau
<mcrod> ah
<gog> i'm a compiler
<Ermine> gogc
<mcrod> gog may I hug you
<heat> OH gog let me send you my cat pics
<gog> yes
<heat> i have some really cute ones from today
* mcrod hugs gog
memset has joined #osdev
* gog hug mcrod
<Ermine> finally, my first vulkan triangle
<karenthedorf> Ermine: :srgb_triangle:
<karenthedorf> Wait, this isn't the offical vulkan discord.
<Ermine> yes, #osdev is my twitter
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
<Ermine> anyway, I won't say everything that happened on that way to the triangle
<karenthedorf> First create a vulkan instance and device. Then code the rest of the fscking owl.
<heat> give up when you realize you need to do matrix math
<karenthedorf> (Also, I hope you have the right color space and not the horrible default newbies pick of RGBA8888_UNORM,COLORSPACE_SRGB with no color correction in the shader)
<Ermine> heat: easiest part tbh
<heat> says the math guy
<heat> you know i need to relearn matrix multiplication every six fucking months
<mcrod> matrix math isn’t that bad
<Ermine> I spent a lot of night time to compute eigenvectors, Jordan forms, QR secompositions, etc
<Ermine> I was really lucky with my linear algebra seminarist
<heat> i understand, but otoh i always forget how to fucking MULTIPLY A FUCKING MATRIX HOW DOES ONE DO THAT
<heat> it's magic man
<mcrod> write a game engine
<mcrod> you’ll never forget
<heat> game engines use linear algebra libraries
<Ermine> take lines of the first matrix and multiply it by the columns of the second, ezpz
<mcrod> if you aren’t doing it all bare
<mcrod> what are you learning
<Ermine> anyway, isn't gpu supposed to do that job
<mcrod> note: i’ve never written a game engine
<heat> bro a game engine is a little more than matrix multiplication
<heat> great q ermine, i think it depends?
<Ermine> game engine is a FUCKING LOT
<heat> if you want to do a certain op in the shader or in the CPU
<mcrod> yes i know
<mcrod> game engines are in my mind the Big Three software projects to attain godhood
<mcrod> no, i’m not that dramatic.
<heat> "if you aren't doing it all bare what are you learning" is a terrible sex ed slogan mcrod
sebastiencs has quit [Server closed connection]
X-Scale has joined #osdev
<mcrod> no it’s perfect if you think about it
sebastiencs has joined #osdev
<Ermine> well okay
<Ermine> anyway, the unclear part for me is how graphic pipeline and render pass got assembled
<heat> mcrod, what are the other two?
<heat> dont say os and emulator dont say os and emulator dont say os and emulator
amj has quit [Server closed connection]
amj has joined #osdev
<mcrod> i was going to say os
<Ermine> and ...
spareproject has joined #osdev
<mcrod> game engine, os, C++ compiler
<heat> c++ compiler??? admit it, you were going to say emulator but you're taking the piss instead
<mcrod> :)
<heat> ALTHOUGH a C compiler would probably be in my top enlightening software projects yeah
<heat> not C++. fuck that
energizer has quit [Server closed connection]
<mcrod> C++ is just an exercise in how well you can parse
<mcrod> parsing for me is fucking H A R D
<heat> C++ is super insane, the parsing is insane, don't forget the templates and the PIMPL and the SFINAE and the OH GOD NOT THE CONSTEXPR NO PLEASE NO
<Ermine> you need to admit that your life is too short to implement a useful C++ compiler
<mcrod> NOT THE CONSTEXPR!
energizer has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
<Ermine> you need the goodhood first
<heat> most vexing parse!
<mcrod> for the record
<heat> void f(double my_dbl) {
<heat> }
<heat> int i(int(my_dbl));
<heat> fuck me
<mcrod> you get a medal of honor if you accomplish any of the above projects
<mcrod> someone who does all 3 is considered an honored elder
<Ermine> now I'll maybe rewrite this boilerplate dropping glfw and using libwayland and egl
<heat> problem is none of those projects are ever finished
<mcrod> exactly
<heat> Ermine, seriously reconsider that
<Ermine> why
<karenthedorf> egl? For vulkan?
<heat> you dropped glfw and now you're dealing with egl and wayland insanity, wait now it doesn't work on xorg either
<karenthedorf> But yeah, wayland isn't too insane. X meanwhile...
<heat> oh not egl, they have some windowing extensions
<heat> in vulkan
<heat> WSI?
<karenthedorf> heat: Yes.
j`ey has quit [Server closed connection]
j`ey has joined #osdev
<Ermine> yeah, WSI, my bad
<heat> i love glfw, it's literally perfect
<Ermine> it's hello world, I have no need to have it work on everything
<karenthedorf> GLFW doesn't do the WSI parts of vulkan for you. With the exception of "You need this extension and here's a VkSurfaceKHR. Now code the rest of the swapchain and main loop"
<gog> can't even pronounce glfw
<Ermine> s/work/working/
<heat> gee el eff double-u
<karenthedorf> Making a VkSurfaceKHR yourself is like 2 lines of code.
<gog> eff double-u too
<Ermine> i did that
<heat> fuu
<Ermine> as per tutorial
<gog> double-yew
<heat> did you mean: double-jew
<karenthedorf> Please don't use vulkan-tutorial, if that's what you mean by 'tutorial', it's not maintained and has synchronization bugs.
<mcrod> is it sex time yet
<heat> gog the antisemtic darn
<heat> mcrod, wrong window
<mcrod> ah right
<Ermine> well i'm already using it
<gog> i didn't mean that heat
<heat> isn't j -> y a pretty common nordic pronounciation
<heat> maybe swedish only?
<gog> i meant yew as in the tree
<heat> i know dont worry i'm not cancelling you
<heat> i am not a right winger
<gog> i'm cancelled already it's fine
<gog> you can cancel me
* mcrod ok’s gog
MiningMarsh has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
MiningMarsh has quit [Client Quit]
MiningMarsh has joined #osdev