channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched
#osdev2 = #osdev @ Libera from 23may2021 to present
#osdev @ OPN/FreeNode from 3apr2001 to 23may2021
all other channels are on OPN/FreeNode from 2004 to present
http://bespin.org/~qz/search/?view=1&c=osdev2&y=24&m=7&d=17
11:40:00 <adder> anyone use limine?
11:40:00 <adder> I'm not sure what physical address should I start mapping things from, that is, what should be my first free page
11:41:00 <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
11:42:00 <adder> https://bpa.st/OJWQ
11:42:00 <bslsk05> bpa.st: View paste OJWQ
11:44:00 <adder> I'm trying to recreate limine's virtual memory mappings btw
11:45:00 <adder> that is, just set up my own page tables, identical
11:47:00 <nikolar> Why not just use limine
11:48:00 <adder> I am using limine nikolar :)
11:48:00 <nikolar> So what do you mean by recreating their mappings
11:48:00 <adder> like setting up my own page tables
11:49:00 <zid> nikolapdp why not just use limine
11:50:00 <adder> default response on discord
11:50:00 <adder> just use limine bro
11:51:00 <nikolar> well it's pretty pointless writing 16 and 32bit code just to bootstrap long mode
11:51:00 <nikolar> Thus, use limine
11:51:00 <nikolar> Ie, let someone else do that
11:51:00 <adder> actually it's quite educational, but yeah I ended up using limine
11:51:00 <adder> if I manage to get it working, that is
11:52:00 <nikolar> It was pretty easy when I did it
11:52:00 <adder> anyway, wtf should my free_page be
11:53:00 <nikolar> free_page?
11:54:00 <adder> yeah the physical address of the first available page
11:54:00 <adder> ...frame, I think
11:57:00 <klys_> good options start at 0x100000 (1MB) with x86
11:59:00 <nikolar> Wasn't there a limitation that dma can only use the first 16mb of physical memory
12:05:00 <zid> for.. ISA
12:05:00 <zid> nikolapdp: have you considered limine?
12:06:00 <nikolar> zid i forgor :|
12:08:00 <zid> is limine limeen or li mine btw
12:09:00 <zid> limmy né
12:09:00 <nikolar> Lee-mee-neh I think
12:09:00 <nikolar> I think it's supposed to be Italian
12:10:00 <zid> oh god
12:10:00 <zid> or japanese I guess?
12:10:00 <nikolar> Probably not
12:10:00 <zid> I found an american saying it as part of a latin law phrase
12:11:00 <zid> lim-i-neh was right yea
12:11:00 <nikolar> Yeah I was just about to say that
12:11:00 <zid> but the neh is a soft ehhh not a é
12:11:00 <nikolar> So if latin then definitely Lee-mee-neh
12:11:00 <zid> https://limine-bootloader.org/
12:11:00 <bslsk05> limine-bootloader.org: Limine
12:11:00 <zid> so you can install it, or read the source
12:12:00 <zid> but you can't find out anything about how to install or use it
12:12:00 <nikolar> It tells you it's using its own protocol and links to it though
12:12:00 <nikolar> In the readme
12:12:00 <zid> https://github.com/limine-bootloader/limine better than their actual website
12:12:00 <bslsk05> limine-bootloader/limine - Modern, advanced, portable, multiprotocol bootloader and boot manager. (135 forks/1705 stargazers/BSD-2-Clause)
12:13:00 <nikolar> Indeed
12:15:00 <zid> interesting, it enables the pml5 by default
12:15:00 <zid> I'm not sure how I feel about that
12:16:00 <zid> I'd think a pml5 unaware kernel is just going to explode on that, the first time it tries to swap cr4?
12:17:00 <nikolar> If you're using limine, you should know to request pml4 instead
12:18:00 <nikolar> zid
12:18:00 <nikolar> > The default mode (when this request is not provided) is LIMINE_PAGING_MODE_X86_64_4LVL
12:18:00 <zid> oh right I misread
12:18:00 <zid> I was just skimming and looking at the quoted bits in the brackets, oopsie
12:18:00 <zid> "PG is enabled (cr0), PE is enabled (cr0), PAE is enabled (cr4), WP is enabled (cr0),"
12:18:00 <zid> "...(LA57 bit in cr4)."
12:19:00 <zid> Turns out inside the ... there's some text about it being optional, who knew
12:19:00 <nikolar> Lel
12:19:00 <zid> I meant cr2 I think also
12:19:00 <nikolar> Got it
14:27:00 <dostoyevsky2> Does minix play the role of Grub here when booting this 16bit linux? https://www.youtube.com/watch?v=6rwlqmdebxk&t=48
14:27:00 <bslsk05> 'booting ELKS on an old 286 MB from 1,44MB floppy' by rayer314 (00:03:11)
14:31:00 <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
14:31:00 <bslsk05> github.com: elks/bootblocks/boot_minix.c at master · ghaerr/elks · GitHub
15:13:00 <Ermine> You can use dos to boot linux
15:15:00 <clever> Ermine: yep, bootlin
15:19:00 <Ermine> Old minixen worked in real mode afaik so they can be used to boot linux I guess
15:34:00 <adder> my kernel gets stuck when I attempt to reload CR3
15:35:00 <adder> I'm disassembling RIP in qemu and the line that comes out is mov %rax, %cr3
15:35:00 <adder> info registers: RAX=07ff80000004e000
15:36:00 <adder> I'm passing (uintptr_t)(pml4 - hhdm_offset)
15:48:00 <adder> I'm also trying to save the phys addr when instantiating pml4 for the first time and then pass that but no luck
15:49:00 <adder> hm, scrap that
16:11:00 <adder> I end up with just one mapping :(
16:21:00 <mjg> - ATF_REQUIRE(st.st_mode = 0600);
16:21:00 <mjg> + ATF_REQUIRE(st.st_mode == 0600);
16:21:00 <mjg> noice
16:25:00 <heat> mjg, mofer does fbsd have their own fs testing thingy? have they tried xfstests?
16:27:00 <mjg> there is a bunch of crap like fsx
16:27:00 <mjg> i don't know if xfstests specifically were ported
16:27:00 <mjg> i would assume so
16:28:00 <Ermine> s/mofer/mon/
16:28:00 <heat> i kinda need xfstests but i'm missing umount
16:29:00 <heat> and that would require some effort
16:32:00 <mjg> lol
16:32:00 <mjg> you are the hello world kind of guy aren't you
16:33:00 <heat> what
16:46:00 <Ermine> I'm the hello world guy here
16:51:00 <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
16:54:00 <mjg> i'm shitting on it while taking into account 1. this is a one-person project 2. you claim you take it seriously
16:55:00 <mjg> to that end, i don't expect you are going to get a xfs or zfs port
16:55:00 <mjg> i do expect you are going to have a working umount (LOL)
16:56:00 <mjg> maybe you are inhabited by a spirit of some early days unix geezer
16:56:00 <mjg> these dudes had swap configured by hardcoding shit in the kernel
16:56:00 <mjg> did not have a syscall for halting the box
16:56:00 <mjg> so what's umount even
16:56:00 <mjg> are you retyping shit you got from ouija board?
16:57:00 <heat> not sure if there's a single hobby OS with umount
16:58:00 <heat> >i don't expect you are going to get a xfs or zfs port
16:58:00 <heat> sounds ez to me
17:00:00 <heat> porting zfs would probably be a solid testament to my vfs but otoh i dont want to mess with the whole opensolaris deal
17:02:00 <mjg> let me guess
17:02:00 <mjg> having umount automatically means it's not hobby?
17:03:00 <mjg> my impression was that you are larping onyx being a real system
17:04:00 <mjg> with time constraints taken itno account
17:04:00 <heat> umount is a functional edge case that isn't really important in the grand scheme of things
17:04:00 <heat> that's why it's commonly missing
17:05:00 <mjg> i agree run of the mill hobby os probably should not care
17:05:00 <mjg> but then again people who write that don't larp it being a real thing
17:05:00 <mjg> just have something they wanted to do
17:06:00 <mjg> perhaps you can explain your idea of taking the os seriously in a hobby setting
17:08:00 <heat> i try my hardest to make a technically sound system
17:08:00 <heat> even though if anyone's running it in prod LOL PLEASE STOP
17:09:00 <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
17:09:00 <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
17:11:00 <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
17:11:00 <heat> larping implies some shitty immitation of whatever it is you're larping
17:11:00 <mjg> i don't see how one can get that idea given
17:11:00 <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
17:11:00 <mjg> so i very much expect you to stick to a lulfs
17:12:00 <mjg> also meaning this is not usable in actual real-world setting
17:12:00 <heat> it's totally usable in simple cases
17:12:00 * mjg burps
17:12:00 <heat> but if you're expecting it to be google's backbone, well, probably not
17:13:00 <mjg> which part of the following sentence you don't understand:
17:13:00 <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
17:13:00 <mjg> i just noticed i'm missing a 'to' here, maybe that's resulting in confusion
17:14:00 <heat> >but my time is finite and i have to focus to on certain things
17:14:00 <mjg> but in that spirit, do you think adding umount is what qualifies the os for google backbone?
17:14:00 <heat> no, but it definitely helps
17:14:00 <heat> given what e.g containers do with filesystems and mounts
17:14:00 <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
17:15:00 <mjg> i see a lot of ground between "usable at google" and onyx + umount and onyx
17:15:00 <mjg> you know
17:15:00 <heat> i didn't say what for, i always said it's a matter of priorities
17:15:00 <heat> which is why most hobby osen don't have it
17:15:00 <mjg> you gave me bullshit about hobby os not having umount
17:15:00 <mjg> which in this context is not relevant
17:15:00 <mjg> anyhow, this convo is really not getting anywhere, is it
17:15:00 <mjg> so tell you what
17:16:00 <mjg> you get vnode recycling goin'
17:16:00 <mjg> and i'm gonna test it
17:16:00 <mjg> how is that
17:16:00 <heat> in any case onyx with umount is probably usable for oracle's backbone
17:16:00 <heat> call me larry we'll settle some things
17:16:00 <mjg> larry said he is rolling out sortix
17:17:00 <heat> i would love to get inode recycling but my dcache is leaking refs and i don't know where
17:18:00 <heat> but it ends up actually leaking filesystem inodes cuz they never get reaped by the fs code, yay
17:19:00 <mjg> could unmount support help debug that
17:19:00 <mjg> :thinkingface:
17:19:00 <heat> yeah if xfs found it
17:19:00 <heat> xfstests i mean
17:20:00 <mjg> so i just pulled on onux and see the zero page stuff
17:20:00 <mjg> you are going all linux
17:20:00 <heat> what zero page stuff?
17:20:00 <mjg> anon: Flush the TLB when mapping over zero pages
17:21:00 <heat> other systems don't do zero pages?
17:21:00 <mjg> bsds and solaris don't
17:21:00 <heat> i thought it was pretty standard
17:21:00 <mjg> no it's a linuxism as far as i know
17:22:00 <mjg> ey heat, can you give me an operational onyx image with will-it-scale?
17:22:00 <heat> i think geist has mentioned fuchsia does it and they also scan committed pages for all-0s and replace them with zero pages
17:22:00 <heat> l8er, aight?
17:22:00 <mjg> so happens i'm looking at pipes in freebsd and they suck terribly
17:22:00 <mjg> it is plausible onyx is faster(!)
17:22:00 <mjg> i'm in no rush, just sayin'
17:22:00 <heat> my pipes are pretty simple
17:23:00 <mjg> the bsds have a sleepable lock inducing more on/off cpu cycles than necessary when pushing data
17:23:00 <mjg> i verified perf sucks hardcore compared to linux
17:23:00 <heat> i also have a mutex
17:23:00 <mjg> i suspect you have a spinning lock there, in which case it should also suck compared to onyx
17:23:00 <heat> but it spinz
17:23:00 <mjg> right
17:23:00 <mjg> so i expect onyx to do better on these grounds
17:24:00 <mjg> don't you want to know if you do something legitimate better
17:24:00 <mjg> apart from being funny, it's not something i'm going to suffer
17:25:00 <heat> it might yeah
17:29:00 <Ermine> mjg: you can write "optimization for dummies" book
17:30:00 <heat> whatever the fuck vmalloc is doing seems really... odd
17:30:00 <heat> i've seen on /proc/vmallocinfo like ~2300 unpurged vm_areas, each 5 or 6 pagen long
17:31:00 <heat> looks like a dramatic waste of page tablen to me
17:31:00 <dostoyevsky2> > hating on rust is so hot right now
17:33:00 <mjg> Ermine: 1. don't PESSIMAL 2. the end
17:34:00 <Ermine> I haven't seen any hot rust haters
17:34:00 <Ermine> mjg: don't PESSIMAL is easier said than done
17:35:00 <dostoyevsky2> Ermine: I wanted to say something but then I forgot as I was too busy hating rust
17:35:00 <mjg> Ermine: step 0. is FUCKING PROFILE
17:35:00 <mjg> Ermine: a real workload
17:36:00 <Ermine> and then
17:36:00 <mjg> then break it down into smaller parts you can ubench
17:36:00 <mjg> to get better visibility
17:36:00 <heat> Ermine, find me a hot C programmer
17:36:00 <heat> that's not named bryan cantrill
17:36:00 <Ermine> I believe openbsd and freebsd people know what is profiling
17:36:00 <mjg> here is an easier guide by Geezer McUnix
17:37:00 <mjg> just claim it's all i/o
17:37:00 <Ermine> heat: bryan is rust guy isn't he
17:37:00 <heat> historically a C programmer
17:37:00 <mjg> openbsd know about profiling about as much as they do about security, to my understanding anyway
17:37:00 <heat> i don't think he writes code anymore
17:37:00 <geist> heat: yeah re: scanning for zeros, though that's generally replaced now by a zram style compressor
17:38:00 <heat> oooh fancy
17:38:00 <geist> the page compressor detects zeros while it's at it and dedups it
17:38:00 <mjg> what kind of stats are you getting on this?
17:38:00 <geist> zeros? lots, annoyingly. user space software sucks
17:38:00 <geist> they're always allocating some large ass thing and zeroing it out and then not touching it
17:38:00 <mjg> that i know, but liek what's the reality there
17:39:00 <Ermine> heat: gotta admit poeterring is hot
17:39:00 <mjg> oh ye the memset(buf, 0, GIGANTISH) before memcpy
17:39:00 <mjg> classic
17:39:00 <geist> enough that it shows up
17:39:00 <mjg> wait that's in fuchsia?
17:39:00 <geist> and for this particular use case it's all about running in low memory situations
17:39:00 <mjg> so that's yoru own software fucking up like that?
17:39:00 <geist> no swap, not a lot of ram, etc
17:39:00 <geist> some our own, some not
17:39:00 <mjg> i know rust coerces people into zeroing when they don't need to
17:39:00 <geist> exactly, rust is a big offender
17:40:00 <mjg> system's language right there
17:40:00 <geist> and in general 'safe' c++ is too, since the google style guide, etc has rules about always zeroing everything, etc
17:40:00 <mjg> have you tried looking at total thread counts?
17:40:00 <mjg> because based on what i had seen up to this point i also expect you get plenty of avoidable threads
17:40:00 <geist> probably
17:40:00 <mjg> speaking of lowmem 'n shit
17:40:00 <geist> keep in mind it's a microkernel, so lots of threads is sort of par the course
17:40:00 <mjg> certainly
17:41:00 <mjg> i'm saying the rustards like to "thread pool" a lot
17:41:00 <mjg> and by thread pool they just spawn n threads cause why not
17:41:00 <geist> a few hundred processes, probably 5-10 threads a piece, etc
17:41:00 <geist> easily over 1k threads
17:41:00 <mjg> multiply that fuckton of procs spawned and you get a disaster
17:41:00 <mjg> there is the idea that spawned threads are cheap
17:41:00 <geist> well we tune everything for that
17:41:00 <heat> C++ does that unavoidably
17:42:00 <heat> also never forget CHROMIUM is also fuchsia software
17:42:00 <mjg> i firefox, no that it acts sane
17:42:00 <mjg> not*
17:42:00 <geist> yep. that's i think one of the biggest offenders, and largely a black box
17:42:00 <Ermine> does it fuck up threading
17:42:00 <heat> i meant re: memset over allocated memory
17:43:00 <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
17:43:00 <mjg> kind of a sellout mentality mon
17:43:00 <mjg> to not even bitch about it :-P
17:43:00 <geist> yah a general idiom everywhere is foo bar = {}; for structs, etc
17:43:00 <mjg> you would think rust with all its strictness would precisely be the lang to NOT need this
17:43:00 <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
17:44:00 <Ermine> vulkan tutorial i'm following does VkLol lol{};
17:44:00 <geist> the best way to get your voice heard is pick your battles, and dont turn into a negative nancy
17:44:00 <heat> good
17:44:00 <mjg> meanwhile even the internals love to zero to shut up the compiler
17:44:00 <geist> but actually that's a really gnarly feature we have enabled in the compiler: tell it to fill all locals with garbage
17:44:00 <geist> it finds bugs, but it's so much extra work
17:44:00 <mjg> hm
17:44:00 <mjg> is that really helpful tho?
17:44:00 <heat> yep
17:45:00 <mjg> do you have asan et al?
17:45:00 <geist> occasionally, yes
17:45:00 <mjg> i would epxect that to sort things out
17:45:00 <geist> though i have to admit we haven't found much in the kernel with it
17:45:00 <geist> we do
17:45:00 <Ermine> how to enable this feature?
17:45:00 <heat> bugfree MINIMAL microkernel vs bugfull SHIT BLOATED monolithic kernel
17:45:00 <geist> hmm, i forget the switch. it's a clang feature
17:45:00 <geist> look for something like 'fill' etc
17:46:00 <mjg> well i don't get it -- what does it find that (k)asan does not?
17:46:00 <geist> it's cheap to run all the time, whereas kasan is not
17:46:00 <mjg> cause if it is worthwhile i'll try it ou on my product
17:46:00 <mjg> oh you always run it?
17:46:00 <geist> yes
17:46:00 <mjg> ok that's different
17:47:00 <mjg> i assumed something strictly for a test farm
17:47:00 <geist> there's a performance hit for sure. but i think the general idea is it's acceptable
17:47:00 <mjg> defo to ponder
17:47:00 <mjg> well i presume you are operating with some specified budget
17:47:00 <mjg> as opposed to "as fast as possible"
17:47:00 <geist> and yo ucan individually override it, fwiw. some some of the core data structures we have tagged with the attribute to disable
17:47:00 <geist> right
17:48:00 <geist> one thing it does that you can't eaisly do any other way is it also zeros out paddings within structures and objects
17:48:00 <geist> since you otherwise can't easily get to that stuff
17:48:00 <geist> again, i find the whole thing pretty dubious but the security folks are very keen on that sort of thing
17:48:00 <geist> so it's a give and take
17:48:00 <mjg> dude
17:49:00 <mjg> security folk are only take
17:49:00 <mjg> and lie while doing it
17:49:00 <Ermine> is that filling thing enabled at compile time
17:49:00 <geist> right, so you have to achieve a balance
17:49:00 <Ermine> ?
17:49:00 <geist> Ermine: yes
17:49:00 <geist> it generates extra code to fill stuff on creation
17:49:00 <mjg> fwiw linux likes to be built with zeroing registers
17:49:00 <mjg> i mean vars
17:49:00 <geist> zeroing registers i think we also enabled too
17:50:00 <geist> there's a security switch to zero registers before exiting a function that i think we have on on debug builds
17:50:00 <mjg> that one comes with a huge turd in gcc tho
17:50:00 <geist> really the big one we have is secure stacks (on x86) and shadow call stacks (on arm)
17:50:00 <mjg> say you have void func(...., bool loflag) { char buf[GIGANTISH]; if (!lolflag) return; .... }
17:50:00 <geist> that's honestly the big one, personally i think if you have that on the other ones are much less interesting
17:50:00 <mjg> it's going to emit zeroing the buf
17:50:00 <mjg> even for the immediate return case
17:51:00 <heat> -ftrivial-auto-var-init=zero mons
17:51:00 <geist> ah yeah. you can also tell it to zero init with something like 0xaaaaaa iirc
17:51:00 <geist> fill values that end up with a non canonical value i've found to be pretty great
17:52:00 <heat> yes
17:52:00 <heat> but =zero is supposed to be prod-ready
17:52:00 <heat> its safer than making it crash
17:52:00 <mjg> there isa funny story in openbsd
17:52:00 <mjg> they had the same poison value for years they would init stuff by hand with
17:52:00 <mjg> then they flipped bits the other way and found more bugs
17:52:00 <mjg> :d
17:53:00 <mjg> not surprising, but funny
17:53:00 <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
17:53:00 <geist> and honestly i think that finds more use-after-frees than anything else i've seen
17:53:00 <geist> or general corruption
17:53:00 <Ermine> crash > doing shit
17:53:00 <heat> uefi is high on magic values too
17:54:00 <mjg> in the entire ordeal i would be worried about reproducibility of builds though
17:54:00 <geist> it's pretty good about finding dma corruption and general hardware instability
17:54:00 <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
17:55:00 <geist> heck we even found a ARM machine a few years back in our test fleet that literally had a broken floating point unit
17:55:00 <geist> would generate bad vectors and we'd see it in a unit test, on that one machine
17:55:00 <mjg> :p
17:55:00 <mjg> hardware was a mistake mon
17:55:00 <geist> but what happens is the kernel tends to be the canary, since the debug builds have a crapton of assserts and internal checks
17:55:00 <geist> tends to be the thing that stubs its toe first
17:55:00 <geist> or stray DMAs over the kernel
17:56:00 <geist> not having ECC is a mistake, full stop
17:56:00 <geist> but alas.
17:56:00 <geist> 9/10 times a hardware failure in the test fleet is bad ram
17:56:00 <Ermine> should i buy ecc memory for desktop
17:57:00 <geist> well, a) you need a desktop machine that can do it (AMD machines can, intels probably no, screw intel)
17:57:00 <geist> b) it'll be probably 2x the price
17:57:00 <geist> c) you'll lose a little bit of performance
17:57:00 <mjg> 2x the price, 0.999999x the crashes
17:57:00 <geist> for a server, 100%. for a file server? 100%
17:58:00 <geist> well, crashes is fine. corruption is what i care about
17:58:00 <mjg> your storage is of more concern in a desktop
17:58:00 <geist> i dont want it silently corrupting things
17:58:00 <mjg> ye i agree, things are not good here
17:58:00 <geist> which i had, years ago. a file server that silently corrupted my shit (a bunch of mp3s at the time)
17:58:00 <mjg> well that was not necessarily ram
17:58:00 <geist> mp3 corruption is annoying since it can take a while to notice it
17:59:00 <mjg> storage going bad is pretty standard
17:59:00 <geist> it was 100% ram because once i noticed corruption (via md5 summing stuff) i did a ram test and it was hella broken
17:59:00 <mjg> which is what i was after in the above comment
17:59:00 <mjg> so for example zfs checksums stuff and has copies specifically to combat shite storage
17:59:00 <geist> you could md5 sum the same file, entirely in the file cache and it would get a different answer
18:00:00 <geist> yep, that would help a lot now. this was like 20 years ago
18:00:00 <mjg> i think this is when zfs got the feature mon :D
18:00:00 <geist> 20 years ago you'd have to run SOLARIS
18:00:00 <mjg> albeit at the time you probably had to be on solaris
18:00:00 <geist> to get zfs
18:00:00 <acidx> I'd take corrupted mp3s over running 20 year old solaris
18:00:00 <geist> bbiab. gotta go. boat docking
18:00:00 <mjg> well a production-quality freebsd port was not far off from that timeline mon
18:05:00 <heat> CHECKSUMS BABY
18:05:00 <heat> WOOOO
18:16:00 <mjg> checksummen == good
18:16:00 <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
18:17:00 <mjg> portable to what
18:17:00 <mjg> discord?
18:17:00 <kof673> "in case you don't have a 32-bit type" lol
18:17:00 <mjg> ah the configure spirit
18:18:00 <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
18:19:00 <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
18:19:00 <kof673> so that is really the only outlier IMO
18:20:00 <heat> jesus
18:20:00 <heat> that's terrible
18:20:00 <kof673> lol
18:20:00 <heat> also wtf is wrong with your ->
18:22:00 <kof673> too any parens or spacing?
18:22:00 <kof673> *many
18:23:00 <kof673> 36-bit should be identical to 32...just clamp to 32 for safety where needed i believe
18:25:00 <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
18:26:00 <heat> the too many parens is weird but i get it
18:26:00 <heat> the ptr -> member thing is terrible though, congrats
18:47:00 <Ermine> heat: are there any specific complexities in implementing SCM_RIGHTS over datagram sockets?
18:48:00 <kof673> i did find one interesting post, but did not save
18:49:00 <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
18:50:00 <kof673> that was how he read the standards anyways "any pointer" he included void * cast to/from function pointers
18:51:00 <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.
18:53:00 <kof673> there would still be separate data and function pointers, but void * could hold either
18:58:00 <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
19:12:00 <kof673> "spot the bug" the 8-bit/9-bit cases should not be shifting by 13 lol those are just for completeness but :D
19:14:00 <netbsduser> Ermine: i think most implementations of right passing include a tracing GC
19:15:00 <Ermine> netbsduser: that's for both stream and datagram sockets, I'm asking for stuff which is dgram-specific
19:15:00 <Ermine> Heard that it's broken in freebsd
19:15:00 <netbsduser> it's different in freebsd
19:15:00 <netbsduser> i had to deal with this for systemd
19:15:00 <netbsduser> i forgot the exact details
19:16:00 <netbsduser> but it (together with SCM_CREDS/SCM_CREDENTIALS) differs subtly between freebsd and linux
19:17:00 <netbsduser> expect special fun with MSG_PEEK
19:28:00 <chiselfuse> is dtrace useful/used much nowadays?
19:35:00 <mjg> on linux no
19:40:00 <chiselfuse> mjg: what compensates on linux then?
19:41:00 <mjg> ebpf
20:34:00 <heat> Ermine, i don't think so
20:34:00 <heat> but tbqh i dunno
20:35:00 <heat> i'm not a SCM_RIGHTS specialist, and this is all COMPLETELY UNDOCUMENTED IN POSIX
20:35:00 <heat> POSIX THE GREAT STANDARD THAT DOES NOT DOCUMENT IMPORTANT STUFF
20:35:00 <Ermine> yeah, posix, you had one job
20:36:00 <heat> they basically say "SCM_RIGHTS lets you pass fds, here's the struct" and boom, nothing else
20:36:00 <heat> MSG_PEEK behavior? nope, not specified!
20:56:00 <sortie> heat: It doesn't even say that much
20:56:00 <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
20:56:00 <sortie> It's a bit wild whenever POSIX tries to standardize something as a stub that you cannot use, like ioctl or posix_devctl
20:59:00 <heat> ioctl was entirely defined for the best feature ever, STREAMS
21:01:00 <Ermine> do streamers use STREAMS
21:03:00 <nikolar> STREAMS
21:08:00 <Ermine> what is even posix_devctl
21:09:00 <heat> it's a new made up ioctl
21:09:00 <heat> that *no one* implements
21:09:00 <Ermine> google gives links to qnx docs
21:09:00 <Ermine> but those redirect to their home page
21:10:00 <Ermine> posix, you had one job [2]
21:10:00 <heat> posix is the US congress of operating systems
21:10:00 <heat> in that they pretend to work but don't actually do anything of note
21:12:00 <heat> sorry, pthreads were okay, posix_spawn ended up being /okay/ too
21:18:00 <Ermine> another day, another pipewire issues
21:19:00 <heat> classic
21:19:00 <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
21:20:00 <Ermine> or it is a miracle
21:21:00 <heat> RING THE CHURCH BELL
21:21:00 <Ermine> not so long ago zoom just crashed when I tried to share my screen in sway
21:21:00 <heat> THE YEAR OF THE LINUX DESKTOP IS UPON US
21:21:00 <Ermine> that's why I have x11 plasma as a backup desktop
21:23:00 <Ermine> minimalism luller moment, rofi crashes ocassionally
21:24:00 <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?
21:25:00 <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?
21:26:00 <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.
21:27:00 <karenthedorf> gcc does what I just described.
22:00:00 <gog> karenthedorf: generally most ISRs will push for the non-ec case
22:01:00 <gog> karenthedorf: https://github.com/adachristine/sophia/blob/main/kc/core/cpu/exceptions.S
22:01:00 <bslsk05> github.com: sophia/kc/core/cpu/exceptions.S at main · adachristine/sophia · GitHub
22:02:00 <gog> line 27
22:02:00 <gog> or rather, line 4 begins the macro, like 27 begins the condition applied to the macro
22:03:00 <karenthedorf> gog: Yeah, other than a few specific ones with vectors <32
22:03:00 <karenthedorf> But those are some pretty critical ones like #PF
22:04:00 <gog> my macros cover all current cases
22:04:00 <gog> i think
22:05:00 <gog> but i only actually define bodies for #PF and #GP
22:06:00 <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)
22:06:00 <bslsk05> pastebin.com: .macro common_interrupt_stub push %r11 push %r10 push %r9 push %r8 - Pastebin.com
22:08:00 <gog> that's a workable approach too, but for me i pass the entire stack frame as a parameter to the C code
22:09:00 <gog> so it always has to be the same size
22:09:00 <gog> interrupts and exceptions are convenient times to do context switches
22:10:00 * vdamewood inserts a fish into gog's interrupt handler
22:10:00 <karenthedorf> Yeah I could have INTERRUPT_STUB push 16 bytes. Or have EXCEPTION_STUB pass 16 above the stack pointer.
22:10:00 * gog vectors to fishy
22:10:00 <karenthedorf> Depending if I want the EC in the stack frame or passed separately
22:10:00 <gog> yeah that's essentially the same approach as me, only two different macros instead of one with conditionals
22:18:00 <heat> karenthedorf, push a dummy error code
22:18:00 <heat> and keep it in the stack
22:18:00 <karenthedorf> That's probabally the better way yeah.
22:18:00 <heat> then it's ez to handle any case, no ifs buts and maybes
22:30:00 <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.
22:30:00 <heat> add $8, %rsp; you don't actually need to store :)
22:36:00 <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.
22:36:00 <heat> aight
22:37:00 <heat> also i meant sub, not add :)
22:37:00 <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.
22:39:00 <heat> gcc and clang prefer weird stuff sometimes
22:39:00 <heat> it *might* be that it's 0.01% faster, i dunno i'm not a compiler :)
22:40:00 <vdamewood> lea for math, anyone?
22:41:00 <heat> https://developer.nvidia.com/blog/nvidia-transitions-fully-towards-open-source-gpu-kernel-modules/
22:41:00 <bslsk05> developer.nvidia.com: NVIDIA Transitions Fully Towards Open-Source GPU Kernel Modules | NVIDIA Technical Blog
22:41:00 <puck> s/Open.*/Female/bs
22:41:00 <puck> oh right wrong channel
22:41:00 <puck> ignore my shitposting
22:42:00 <heat> what
22:42:00 <heat> explain!
22:44:00 <puck> anyways, i'm a bit sad that this requires the nvidia open driver still, rather than nouveau
22:45:00 <heat> ohhhhhhhhhhhhh i get the joke now haha
22:45:00 <heat> well nouveau was never an option
22:46:00 <heat> this driver needs to work on linux and windows and mac and freebsd and whatever
22:46:00 <Ermine> nova is on the way
22:46:00 <vdamewood> Yum, FreeBSD.
22:46:00 <mcrod> hi
22:46:00 * vdamewood licks FreeeBSD.
22:46:00 <heat> writing two drivers for their GPUs is futile and only something some really big company like Intel could do
22:46:00 <mcrod> oh my god
22:47:00 <mcrod> NVIDIA is embracing open sauce?
22:47:00 <Ermine> nvidia is big isn't it
22:47:00 <heat> yeah they're taking their open-source hormones
22:47:00 <puck> heat: does cuda? :p
22:47:00 <vdamewood> Ermine: Msybe a little
22:47:00 <mcrod> i don’t believe it
22:47:00 <heat> intel is way bigger than nvidia
22:47:00 <mcrod> if you’d say this would happen 10 years ago i’d throw you out the window
22:48:00 <heat> intel does fucking everything at the same time
22:48:00 <mcrod> intel sucks
22:48:00 <mcrod> you also suck
22:48:00 <Ermine> mcrod: don't hold your breath, userspace part is still closed source
22:48:00 <heat> fuck you mike
22:48:00 <mcrod> fuck you pedro
22:48:00 <mcrod> Ermine: oh
22:48:00 <mcrod> well, progress
22:49:00 <Ermine> heat: there just was a discussion on #nouveau , and devs say that nvidia kernel driver doesn't maintain stable uapi
22:49:00 <heat> is nouveau still a trashfire or did they get their things together?
22:49:00 <Ermine> they do new driver, in rust
22:49:00 <heat> i know, my nvidia modules spam my dmesg when i update the nvidia-utils package
22:50:00 <mcrod> nouveau sucks
22:50:00 <heat> a whole new driver? kernel driver?
22:50:00 <Ermine> yes
22:50:00 <mcrod> they can’t even get their current one right
22:50:00 <mcrod> and that’s not because of language
22:50:00 <Ermine> it's called nova
22:50:00 <sauce> so i take it this is not going to be mainlined
22:51:00 <heat> this = what?
22:51:00 <sauce> nvidia's foss drivers
22:51:00 <heat> ofc not
22:52:00 <Ermine> heat: https://gitlab.freedesktop.org/drm/nova/-/tree/nova/drivers/gpu/drm/nova?ref_type=heads
22:52:00 <bslsk05> gitlab.freedesktop.org: drivers/gpu/drm/nova · nova · drm / nova · GitLab
22:52:00 <mcrod> why wouldn’t they be mainlined?
22:52:00 <Ermine> 3 months ago though
22:52:00 <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
22:53:00 <heat> mcrod, there's a whole API wrapper layer around nvidia.ko
22:53:00 <heat> because they do share this driver between systems
22:53:00 <heat> mainlining (making it "linux-pure") would be anti-business
22:53:00 <mcrod> ah
22:54:00 <Griwes> I've heard whispers of maybe landing something, just not in /drm/
22:54:00 <Ermine> amd shares stuff between systems as well, doesn't it
22:54:00 <heat> probably not
22:54:00 <heat> considering radeon and amdgpu are different drivers
22:54:00 <Griwes> the windows graphics layer is its own beast that needs its own special treatment
22:54:00 <Ermine> that's what they said me in some issue
22:55:00 <Griwes> so there's already a whole bunch of stuff that's not shared
22:55:00 <heat> intel literally develops two completely separate drivers with two separate teams with no shared knowledge between
22:55:00 <Griwes> and a huge portion of the shared code has been pushed into the firmware on the gsp
22:56:00 <Ermine> that explains why intel windows drivers work better than linux ones
22:57:00 <heat> do they?
22:57:00 <karenthedorf> If it's anything like AMD, nouveau will continue to exist, poorly maintained, in "legacy hardware" mode until it dies of bitrot.
22:57:00 <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
22:58:00 * karenthedorf types this from a laptop that's too old for working AMDGPU support
22:58:00 <karenthedorf> And the last fglrx release was over a decade ago.
22:59:00 <Ermine> heat: I feel that yes
23:01:00 <puck> mind you, the nouveau driver runs at full speed under modern GPUs (GSP, same as the open nvidia driver)
23:03:00 <puck> (afaict)
23:06:00 <heat> nouveau driver running at full speed must be like a scooter at full speed
23:06:00 <mcrod> can confirm nouveau is garbage on my 3090ti
23:07:00 <mcrod> not using the proprietary drivers might as well be death
23:07:00 <mcrod> i don’t even know why they bother
23:08:00 <mcrod> nouveau has been around since forever and it’s nowhere close to decent usability
23:08:00 <Ermine> did you try with nvk_zink?
23:08:00 <Ermine> nvk+zink i mean
23:09:00 <mcrod> no
23:10:00 <mcrod> that sounds like it would be more trouble than it’s worth
23:11:00 <heat> you don't get it mcrod
23:11:00 <heat> you get to be the beta tester for a 3D driver
23:11:00 <heat> it's gr8
23:11:00 <heat> don't worry this one is written in rust
23:12:00 <Ermine> well I just was genuinely curious
23:12:00 <Ermine> I can't test since I don't have nvidia hardware
23:12:00 <heat> it's possible it might help, it's possible it might crash
23:12:00 <heat> oh wait it can't crash, it's rust
23:13:00 <heat> it'll just panic!()
23:13:00 <Ermine> it panics instead
23:13:00 <heat> .unwrap()
23:14:00 <Ermine> did I say that Karol Herbst is rust fan apparently?
23:14:00 <heat> it's pretty clear he's a rust fan yeah
23:14:00 <mcrod> who the fuck is that
23:14:00 <heat> main guy behind nouveau
23:15:00 <mcrod> ah
23:15:00 <gog> i'm a compiler
23:15:00 <Ermine> gogc
23:15:00 <mcrod> have a cat https://usercontent.irccloud-cdn.com/file/q6BlfgJo/1721258131.JPG
23:15:00 <mcrod> gog may I hug you
23:15:00 <heat> OH gog let me send you my cat pics
23:15:00 <gog> yes
23:15:00 <heat> i have some really cute ones from today
23:16:00 * mcrod hugs gog
23:17:00 * gog hug mcrod
23:20:00 <Ermine> finally, my first vulkan triangle
23:20:00 <karenthedorf> Ermine: :srgb_triangle:
23:20:00 <karenthedorf> Wait, this isn't the offical vulkan discord.
23:21:00 <Ermine> yes, #osdev is my twitter
23:22:00 <Ermine> anyway, I won't say everything that happened on that way to the triangle
23:23:00 <karenthedorf> First create a vulkan instance and device. Then code the rest of the fscking owl.
23:23:00 <heat> give up when you realize you need to do matrix math
23:24:00 <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)
23:24:00 <Ermine> heat: easiest part tbh
23:24:00 <heat> says the math guy
23:24:00 <heat> you know i need to relearn matrix multiplication every six fucking months
23:25:00 <mcrod> matrix math isn’t that bad
23:26:00 <Ermine> I spent a lot of night time to compute eigenvectors, Jordan forms, QR secompositions, etc
23:26:00 <Ermine> I was really lucky with my linear algebra seminarist
23:26:00 <heat> i understand, but otoh i always forget how to fucking MULTIPLY A FUCKING MATRIX HOW DOES ONE DO THAT
23:26:00 <heat> it's magic man
23:27:00 <mcrod> write a game engine
23:27:00 <mcrod> you’ll never forget
23:27:00 <heat> game engines use linear algebra libraries
23:27:00 <Ermine> take lines of the first matrix and multiply it by the columns of the second, ezpz
23:27:00 <mcrod> if you aren’t doing it all bare
23:28:00 <mcrod> what are you learning
23:28:00 <Ermine> anyway, isn't gpu supposed to do that job
23:28:00 <mcrod> note: i’ve never written a game engine
23:28:00 <heat> bro a game engine is a little more than matrix multiplication
23:28:00 <heat> great q ermine, i think it depends?
23:28:00 <Ermine> game engine is a FUCKING LOT
23:28:00 <heat> if you want to do a certain op in the shader or in the CPU
23:29:00 <mcrod> yes i know
23:29:00 <mcrod> game engines are in my mind the Big Three software projects to attain godhood
23:29:00 <mcrod> no, i’m not that dramatic.
23:29:00 <heat> "if you aren't doing it all bare what are you learning" is a terrible sex ed slogan mcrod
23:30:00 <mcrod> no it’s perfect if you think about it
23:30:00 <Ermine> well okay
23:32:00 <Ermine> anyway, the unclear part for me is how graphic pipeline and render pass got assembled
23:33:00 <heat> mcrod, what are the other two?
23:33:00 <heat> dont say os and emulator dont say os and emulator dont say os and emulator
23:34:00 <mcrod> i was going to say os
23:34:00 <Ermine> and ...
23:35:00 <mcrod> game engine, os, C++ compiler
23:35:00 <heat> c++ compiler??? admit it, you were going to say emulator but you're taking the piss instead
23:35:00 <mcrod> :)
23:36:00 <heat> ALTHOUGH a C compiler would probably be in my top enlightening software projects yeah
23:36:00 <heat> not C++. fuck that
23:36:00 <mcrod> C++ is just an exercise in how well you can parse
23:36:00 <mcrod> parsing for me is fucking H A R D
23:37:00 <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
23:37:00 <Ermine> you need to admit that your life is too short to implement a useful C++ compiler
23:37:00 <mcrod> NOT THE CONSTEXPR!
23:38:00 <Ermine> you need the goodhood first
23:38:00 <heat> most vexing parse!
23:39:00 <mcrod> for the record
23:39:00 <heat> void f(double my_dbl) {
23:39:00 <heat> }
23:39:00 <heat> int i(int(my_dbl));
23:39:00 <heat> fuck me
23:39:00 <mcrod> you get a medal of honor if you accomplish any of the above projects
23:39:00 <mcrod> someone who does all 3 is considered an honored elder
23:39:00 <Ermine> now I'll maybe rewrite this boilerplate dropping glfw and using libwayland and egl
23:39:00 <heat> problem is none of those projects are ever finished
23:40:00 <mcrod> exactly
23:40:00 <heat> Ermine, seriously reconsider that
23:40:00 <Ermine> why
23:40:00 <karenthedorf> egl? For vulkan?
23:40:00 <heat> you dropped glfw and now you're dealing with egl and wayland insanity, wait now it doesn't work on xorg either
23:40:00 <karenthedorf> But yeah, wayland isn't too insane. X meanwhile...
23:40:00 <heat> oh not egl, they have some windowing extensions
23:40:00 <heat> in vulkan
23:40:00 <heat> WSI?
23:41:00 <karenthedorf> heat: Yes.
23:41:00 <Ermine> yeah, WSI, my bad
23:41:00 <heat> i love glfw, it's literally perfect
23:41:00 <Ermine> it's hello world, I have no need to have it work on everything
23:42:00 <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"
23:42:00 <gog> can't even pronounce glfw
23:42:00 <Ermine> s/work/working/
23:42:00 <heat> gee el eff double-u
23:42:00 <karenthedorf> Making a VkSurfaceKHR yourself is like 2 lines of code.
23:42:00 <gog> eff double-u too
23:42:00 <Ermine> i did that
23:42:00 <heat> fuu
23:42:00 <Ermine> as per tutorial
23:42:00 <gog> double-yew
23:43:00 <heat> did you mean: double-jew
23:43:00 <karenthedorf> Please don't use vulkan-tutorial, if that's what you mean by 'tutorial', it's not maintained and has synchronization bugs.
23:43:00 <mcrod> is it sex time yet
23:43:00 <heat> gog the antisemtic darn
23:43:00 <heat> mcrod, wrong window
23:43:00 <mcrod> ah right
23:43:00 <Ermine> well i'm already using it
23:44:00 <gog> i didn't mean that heat
23:46:00 <heat> isn't j -> y a pretty common nordic pronounciation
23:46:00 <heat> maybe swedish only?
23:47:00 <gog> i meant yew as in the tree
23:48:00 <heat> i know dont worry i'm not cancelling you
23:48:00 <heat> i am not a right winger
23:48:00 <gog> i'm cancelled already it's fine
23:48:00 <gog> you can cancel me
23:49:00 * mcrod ok’s gog