Search logs:

channel logs for 2004 - 2010 are archived at ·· 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

Tuesday, 19 September 2023

00:15:00 <zid> I am growing fish and selling them, does openbsd have this feature yet
00:16:00 <zid> I buy more random fish with my profits, hoping to pull legendaries, who provide passive income and can be put into my other tank
00:16:00 <qookie> where can i short fish
00:17:00 <zid> fish futures market
00:17:00 <kazinsal> insider fish trading
00:20:00 <qookie>
00:22:00 <zid> Possibly, but I can't say in which direction
00:25:00 <zid> There's a place in poland that makes these, I see them in shops occasionally here
00:25:00 <zid> They're pretty good I kinda want one
00:25:00 <zid> The cat might like it if nothing else
00:27:00 <zid> Not that it has ever seen a real fish, probably wouldn't be able to make heads or tails of it
00:29:00 <qookie> can't say i've seen it in stores in poland :^)
00:29:00 <zid> go into many fishing tackle shops? :P
00:29:00 <qookie> that's the thing, i don't :^)
00:30:00 <zid> I am *shocked* you've not seen one then
00:30:00 <qookie> same, produced here => sold in every store here, after all
00:30:00 <zid> Yea, it should be right next to the milk
00:31:00 <zid> milk, full range of gaby fish pillows, weird hotdogs
00:31:00 <qookie> buy a 12 pack of milk, get a fish plush for free
00:32:00 <zid> I think price wise it might end up the other way around
00:33:00 <zid> They're like £25 for the non-tiny ones
00:34:00 <zid> What's that in zenny
00:34:00 <qookie> holy, about 100 zł
00:34:00 <qookie> 130 even damn
00:36:00 <zid> The big ones ain't small
01:47:00 <geist> oh hey look at that, there's a dev board for a stm32h5 series, with a cortex-m33
01:47:00 <geist> not that expensive either, less than $30
05:24:00 <Jari--> morning
05:27:00 <klys> gm.
05:27:00 <Jari--> Nicotine + coffee. Can eat later at any time, eating is not important now:)
05:28:00 <Jari--> 65. day without a single smoke : ]]
05:30:00 <klys> :) yesterday morning I just ate a prot bar and a ham & gouda sandwich for breakfast. tomorrow morning is still seven hours into the future
05:30:00 <zid> wat
05:30:00 <klys> oh it's almost midnight
05:32:00 <klys> gog: ^,,^
05:32:00 <gog> hiii
05:58:00 * kazinsal pets gog
07:49:00 * gog prr
07:51:00 <gog> i had a rough night ugh
07:51:00 <gog> i hate my apartment
08:07:00 <kazinsal> I had apartment inspections yesterday and it was nervewracking
08:07:00 <kazinsal> particularly because this building was built like shit and the floor is slowly separating from the baseboard
08:08:00 <kazinsal> and the floors are the worst cheap laminate found in the country, so I gouged the hell out of it within 20 minutes of moving in
08:18:00 <gog> oof
08:21:00 <sham1> foo
09:01:00 <Ermine> gog: may I pet you
09:03:00 <levitating> Does anyone understand why this disassembles into
09:03:00 <zid> yes
09:03:00 <zid> because you disassembled it wrong
09:03:00 <zid> or assembled, potentially
09:04:00 <zid> It's disassembled as 64bit for sure
09:04:00 <levitating> I just assembled with nasm -efelf64, and this disassembly is from objdump, gdb shows the same. Th
09:05:00 <levitating> This is the only weird thing I've noticed in the disassembly
09:05:00 <zid> a3 00 10 10 00 mov ds:0x101000,eax
09:06:00 <zid> a3 00 10 10 00 b8 00 movabs ds:0x103000b800101000,eax
09:06:00 <zid> a3 00 10 10 00 b8 00 movabs ds:0x103000b800101000,eax
09:06:00 <zid> 30 10
09:06:00 <zid> 32bit, then 64bit disassembly
09:06:00 <zid> did you .bits 32 at some point?
09:07:00 <levitating> Yes! I did, now I need to remember why...
09:07:00 <zid> Because it's 32bit code
09:07:00 <zid> but it explains why when stuffed into a 64bit elf, it disassembles as 64bit code rather cleanly :P
09:08:00 <zid> err uncleanly
09:08:00 <zid> Because it isn't, because you told your assembler to lie
09:08:00 <zid> (which may infact be what you want, you just need to force your disassembler to 32bit mode for that disassembly)
09:11:00 <levitating> Looks fine with objdump configured for i386, thanks!
09:12:00 <levitating> Now back to figuring out why this code doesn't work..
09:12:00 <zid> That's the fun bit though
09:13:00 <levitating> It was, but I've been working on this project on and off for months because I can't get the PAE enabled without it crashing.
09:13:00 <zid> well, that's very debuggable at least
09:13:00 <zid> If you're enabling pae, why are you using 64bit elf?
09:14:00 <zid> like, pae needs to be on to enter 64bit long mode, but you never actually.. use it
09:17:00 <levitating> Hmm, I am following an outdated guide where they identity page a gigabyte or so before entering long mode and starting the kernel.
09:17:00 <heat> that sounds reasonable
09:18:00 <zid> are you starting from real mode or something?
09:18:00 <levitating> Yes I think so
09:19:00 <zid> you.. think so
09:19:00 <heat> what
09:20:00 <zid> heat, my hubris at having enjoyed the nice thunderstorm the other day has led to it being extremely cold and wimdy today :(
09:22:00 <levitating> Like I said it's been a long time since I started this projec and I am no expert to say the least. I boot using grub, I think it's already in protected mode at that point?
09:22:00 <heat> yes
09:22:00 <heat> can you show us the code?
09:22:00 <zid> you can literally just make some 64bit page tables you intend to use somewhere, and switch into long mode with them directly
09:22:00 <zid> from gru
09:23:00 <zid> as long as you leave the page that runs the cpu mode switch mapped in your new page tables so that you don't rip the memory out from under the instruction pointer, it's gtg
09:23:00 <levitating> Here is the code, remember I am just trying to learn.
09:23:00 <bslsk05> ​ runix/src/boot/boot.asm at master · LevitatingBusinessMan/runix · GitHub
09:24:00 <kof13> runix was an old ancient psx (playstation 1) linux port :D just saying :D i don't think anyone will get mad
09:25:00 <zid> PDPT* btw
09:25:00 <kof13> IIRC it was russian
09:25:00 <zid> PDP is a series of small microcomputers from IBM
09:25:00 <levitating> kof13: I actually did search for the name I bit. I called it runix because I intended to write in Rust and my name starts with an R.
09:26:00 <kof13> yeah, you may have to dig to actually find it, it is 2.x something :D
09:26:00 <kof13> i believe it was never "mainlined"
09:27:00 <zid> Your .enable_paging is almost identical to mine
09:27:00 <heat> you say you crash when enabling PAE?
09:27:00 <zid> (except I enable NX too), but it's lacking an lgdt
09:27:00 <zid> lgdt is cool
09:28:00 <levitating> zid: Right, I am not sure where I got PDPT from.
09:28:00 <heat> that seems odd
09:28:00 <zid> PDP*
09:28:00 <zid> PDPT is correct
09:28:00 <zid> page directory page table
09:28:00 <heat> i mean PDPT is a table of PDPs
09:28:00 <zid> of PDPTEs
09:28:00 <levitating> heat: After setting cr0 qemu just goes back into the bios.
09:28:00 <zid> you triplefaulted
09:29:00 <zid> -no-shutdown -no-reboot -d int
09:29:00 <zid> run with that
09:29:00 <zid> ah PDP = programmed data processor
09:29:00 <zid> from DEC not IBM if I said IBM
09:29:00 <nortti> oh I presumed you were intentionally lying there, what with "small microcomputers" too
09:30:00 <heat> levitating, oh ok cr0?
09:30:00 <zid> small microcomputers is correct!
09:30:00 <zid> mini?
09:30:00 <heat> so you triple fault when enabling paging? makes sense
09:30:00 <heat> you forgot to actually enable long mode
09:30:00 <nortti> zid: they range from mini (e.g. pdp-8, pdpd-12) to mainframe (pdp-11)
09:31:00 <nortti> er
09:31:00 <zid> oh yea where's the wmwrsrs
09:31:00 <heat> you need a proper GDT with at least a compat 32-bit code segment and a 64-bit code segment
09:31:00 <nortti> pdp-11* pdp-10*
09:31:00 <zid> nah he enables long mode heat
09:31:00 <heat> no, the wrmsr is there
09:31:00 <zid> on 153-156
09:31:00 <zid> EFER.LM
09:31:00 <heat> but you need good segments to go along with it
09:31:00 <levitating> zid: Now it hangs and qemu is giving a long output starting with SMM: enter
09:31:00 <zid> yea ignore the SMM ones, at the bottom should be the fault that was tripelfaulting you
09:31:00 <levitating> I am not sure what triple faulting is I'd have to read into it
09:32:00 <levitating> -no-shutdown -no-reboot -d int
09:32:00 <levitating> nvm
09:32:00 <zid> the cpu resetting because it got three exceptions in a row
09:32:00 <levitating> wrong clipboard
09:32:00 <levitating> check_exception old: 0x8 new 0xd
09:32:00 <zid> fault -> fault didn't work -> double fault -> double fault didn't work -> reset
09:32:00 <zid> You want the first of the three
09:32:00 <zid> that aren't smm, old should be 0xffff
09:33:00 <zid> (It might only print two I guess, a triplefault is an instant reset, not something you handle)
09:33:00 <heat> zid, 32-bit compat segments are different from 32-bit non-compat right?
09:33:00 <heat> i think so?
09:33:00 <zid> I've never used 32bit compat
09:33:00 <heat> sure you have
09:34:00 <zid> nope
09:34:00 <heat> when switching to 64-bit
09:34:00 <zid> nope
09:34:00 <heat> you need to
09:34:00 <zid> they don't flush until you jump
09:34:00 <zid> you go straight from pmode to long if you do it in this order
09:34:00 <zid> compat is when you go back into 32bit from long
09:35:00 <zid> There's a diagram in the intel manual that I can never find
09:35:00 <heat> hmmm i think you're right yeah
09:35:00 <zid> There are three routes in, and 2 routes out of each mode all in a nice diagram
09:35:00 <zid> and like 16 routes to #GP
09:35:00 <heat> long-mode MMU translations should apply right from the getgo as soon as you enable paging
09:36:00 <zid> but grub is in linear mem not virtual
09:36:00 <zid> so you don't have to play silly games
09:36:00 <zid> you enable paging + long mode, then the iret puts you into *both*
09:36:00 <zid> or however you switch
09:36:00 <zid> jmp 8:
09:36:00 <zid>
09:37:00 <bslsk05> ​ bootstrap/boot/long.asm at master · zid/bootstrap · GitHub
09:37:00 <zid> Literally identical except I enable NX too, and remembered to lgdt so that it won't explode
09:37:00 <zid> but he said the cr0 mov on 33 is what crashes him, which is literally the line before I lgdt anyway, so whatever
09:38:00 <heat> yeah i... i don't see it
09:38:00 <zid> moving into cr0 shouldn't actually change anything until the ret at the dn
09:38:00 <zid> end
09:39:00 <zid> but we haven't heard back from his old 0xffffff yet
09:39:00 <zid> it might infact be the ret
09:40:00 <heat> i tried to build it but the obvious cargo build doesn't work so i ran out of options
09:40:00 <heat> oh well
09:40:00 <levitating> Actually I just tested it, on the mov cr0 GDB gives an error. But the crash occurs when I try to si after that.
09:40:00 <zid> I can't build rust either
09:40:00 <zid> ignore gdb, look at qemu's monitor
09:40:00 <levitating> Which executes the ret
09:41:00 <zid> yea, the ret is guarenteed to fail
09:41:00 <zid> you need to lgdt some 64bit segments, and load your segment selectors, see my github link for reference
09:41:00 <levitating> No need to build rust, I don't use any rust code yet, I was just testing with building without stdlib. You can build by going into src/boot and running make
09:41:00 <levitating> It will just create an iso with the bootcode and grub
09:41:00 <heat> ah ok
09:41:00 <zid> so will zid/bootstrap.git
09:42:00 <heat> zid, you don't *need* the ret
09:42:00 <zid> It uses GRAFTED MOUNT POINTS
09:42:00 <heat> you'll just run in 32-bit compat
09:42:00 <zid> heat: the ret will update all those cr0 cr4 etc bits to be live
09:42:00 <zid> and it'll go nuts and crash
09:42:00 <zid> I think ret will, anyway
09:43:00 <levitating> This is guide I was trying to follow: I am checking out your code rn
09:43:00 <bslsk05> ​ Entering Long Mode | Writing an OS in Rust (First Edition)
09:43:00 <levitating> (not follow directly btw, just trying to figure it out myself with wikipedia and OSDev Wiki)
09:44:00 <zid> looks like ret doesn't cause a reload, if he has one
09:44:00 <heat> well your page tables are borked levitating
09:44:00 <zid> so he does ret; lgdt
09:44:00 <zid> I just do the lgdt
09:45:00 <levitating> heat: Can you spot the issue?
09:45:00 <zid> knowing the fault would be nice..
09:46:00 <levitating>
09:46:00 <zid> it looks *approximately* correct to the first order at least, pml4 contains one entry, [0] which points to a PDPT with a [0] entry, etc
09:47:00 <zid> check_exception old: 0xffffffff new 0xe
09:47:00 <zid> 0: v=0e e=0000 i=0 cpl=0 IP=0010:0000000000100122 pc=0000000000100122 SP=0018:000000000010403c CR2=0000000000100122
09:47:00 <zid> what's at 0x100122
09:47:00 <heat> ok i fixed it
09:47:00 <levitating> I haven't really looked at that yet, because I was running without --no-shutdown as of 20 minutes ago
09:47:00 <zid> 0e is a page fault btw
09:48:00 <zid> you could info tlb
09:48:00 <heat> levitating,
09:48:00 <bslsk05> ​ boot.asm · GitHub
09:48:00 <zid> ooh that was fast
09:48:00 <heat> just a silly logic error
09:49:00 <zid> oh yea, add eax, 8
09:49:00 <levitating> Oh my bad I already had a tiny modification in that area that wasn't commited
09:49:00 <zid> anyway, put info tlb into the monitor
09:49:00 <levitating> info tlb?
09:50:00 <zid> yes?
09:50:00 <heat> page directory entries were all 0 zid
09:50:00 <heat> now they're not
09:50:00 <zid> probably helpful, yea
09:50:00 <zid> as well as not actually.. writing anything
09:51:00 <zid> and using eax for two different things
09:51:00 <zid> it was solid code otherwise
09:51:00 <heat> yeah
09:52:00 <levitating> zid: I actually fixed that but forgot to commit, but I guess I didn't fix it properly. Let me work in heats patch
09:52:00 <zid> info tlb after you try
09:52:00 <zid> This is why I do it in C :P
09:54:00 <levitating> It's not fixed
09:54:00 <zid> info tlb!
09:54:00 <levitating> I am not sure what info tlb is?
09:54:00 <heat> how's it not fixed?
09:54:00 <heat> it's fixed here??
09:55:00 <levitating> hmm weird, gimme a sec
09:55:00 <heat> on KVM (intel) and qemu tcg
09:57:00 <levitating> Okay, I checked out into a previous commit and applied your patch and it worked! Thanks heat
09:59:00 <zid> What I end up with, I have no idea what half this stuff is though :p
09:59:00 <bslsk05> ​ gist:ae5e5ef4aa706c608fafafefee85afe2 · GitHub
09:59:00 <heat> cheers
09:59:00 <levitating> Oh you type info tlb into qemu?
09:59:00 <zid> I think.. 5 pages of kernel, 1 page of stack, then my ramfs
09:59:00 <zid> why didn't you ask, if you didn't know what I meant >_<
10:00:00 <heat> they asked
10:00:00 <zid> they said info tlb? and I said yes
10:00:00 <heat> <levitating> I am not sure what info tlb is?
10:00:00 <zid> oh that's the third time I said it
10:00:00 <zid> but I was busy making my paste rather than responding
10:00:00 <heat> i wanna show off my info tlb too
10:00:00 <zid> My info tlb fuckin *explodes*
10:01:00 <zid> I had to lower the ram limit on qemu, my scrollback can't go far enough on my terminal
10:01:00 <zid> even after upping my scrollback
10:01:00 <zid> turns out mapping a gig a page at a time a couple of times generates a bunch of lines, who knew
10:01:00 <heat>
10:02:00 <bslsk05> ​ info_tlb.txt · GitHub
10:02:00 <zid> that looks like an autogenerated stack address :P
10:02:00 <heat> 70k lines
10:02:00 <zid> I need to remove my bootstrap pages for realisies at some point
10:02:00 <zid> first thing mem_init() should do in kernel is unmap that shit but I just never got around to it
10:03:00 <heat> 0xffff800... is vmalloc space, so that's why it's so fragmented and maps random shit
10:03:00 <heat> 0xffffd... is the physmap, it ends up pretty tidy with 1GB pages
10:03:00 <zid> fffffe8000000000: 0000000000527000 ---DA---W
10:03:00 <zid> ffffff0000001000: 0000000000515000 ----A--UW
10:03:00 <zid> ffffff0000400000: 00000000005f2000 ---DA--UW
10:03:00 <zid> ffffff0000000000: 0000000000514000 ---DA--UW
10:03:00 <zid> I have no idea what this is in mine
10:04:00 <zid> page tables?
10:04:00 <zid> been forever since I messed with this
10:04:00 <heat> maybe? looks plausible looking at the phys addresses
10:04:00 <heat> i don't use recursive page tables
10:04:00 <heat> that's the devil's lettuce
10:05:00 <zid> yea I don't think I actually need that mapping anymore
10:05:00 <zid> I was holding out on "just map everything" for a while and used it
10:05:00 <zid> ffffffff80000000: 0000000000105000 ----A----
10:05:00 <zid> ffffffff80001000: 0000000000106000 ---------
10:05:00 <heat> just map everything ftw
10:05:00 <zid> Who needs the second page of my kernel, not me apparently
10:05:00 <heat> BLOAT
10:06:00 <zid> one day I will write out my actual memory map and prune this crap and make sure it makes sense
10:06:00 <zid> I have random acpi tables and framebuffer bits and stuff strewn all over
10:07:00 <zid> For acpi I literally just picked a pml4e I wasn't using and offset mapped it in I think
10:07:00 <levitating> Hey thanks a lot for all of your help (again)
10:07:00 <zid> 0xffff800...000 + n -> n or whatever, so that I could read my acpi tables
10:07:00 <zid> then never unmapped any of it once I was done
10:09:00 <zid> which again predates the "just map everything", so I think it's in the 'everything' map too and should be using that
10:09:00 <zid> ffun fun
10:10:00 <heat> funsafe-math
10:11:00 <zid> fun-math
10:11:00 <zid> -ffun-math, randomly adds 0.01 to some results
10:11:00 <zid> sometimes sqrts them
10:12:00 <zid> I featured req'd it to wakely
10:13:00 <levitating> The actual reason that it was broken for my local version, was because I was still using EAX as a pointer to PDP even though I had already or'd the present and writable bit on it.
10:15:00 <zid> yep, as mentioned
10:33:00 <mcrod> hi
13:29:00 <heat> ruh roh they oopsied 17.0.0
13:29:00 <bslsk05> ​ Release LLVM 17.0.1 · llvm/llvm-project · GitHub
13:30:00 <gog> oopsie doodle
13:30:00 <gog> maybe somebody there is like me and they're not a good programmer
13:32:00 <Mutabah> Any idea what the issue was? I'm curious
13:33:00 <heat>
13:33:00 <bslsk05> ​ LLVM 17.0.1 released! - Announcements - LLVM Discussion Forums
13:33:00 <heat> >Note that 17.0.0 was pushed out, but contained errors in the version information, so we decided to quickly follow up with 17.0.1
13:36:00 <heat> the fcheck-new flag isn't mentioned in the release notes but yeah i implemented it and its there
16:25:00 <mcrod> hi
16:26:00 <heat> i have a proposal to ban "hi" and "openbsd" in this channel
16:26:00 <gog> hi
16:39:00 <mcrod> C++20 is still not the default?
16:44:00 <mcrod> gog: may I pet you
16:45:00 <gog> yes
16:45:00 <gog> heat: hi
16:46:00 <gog> i'm sad
16:46:00 * mcrod pets gog
16:46:00 * gog prr
16:51:00 <gog> i'm gonna make fake tikka masala for dinner
16:53:00 <gog> i don't have time to make naan bread :(
17:00:00 <jimbzy> NaN bread
17:01:00 <gog> yes
17:01:00 <gog> itis nota number
17:01:00 <gog> it is bread
17:01:00 <gog> bread is not numbers
17:02:00 <heat> bread()
17:03:00 <gog> bread is not a function
17:03:00 <gog> TypeError
17:04:00 <heat> bread is definitely a function
17:04:00 <heat> just like lookuppn
17:14:00 <mcrod> .
17:14:00 <mcrod> heat: guess who joined our company
17:14:00 <heat> linus torvalds??
17:15:00 <mcrod> no
17:15:00 <mcrod> you have two more guesses
17:15:00 <mcrod> it is someone you know
17:15:00 <heat> is it gog
17:15:00 <mcrod> no
17:15:00 <heat> is it me
17:15:00 <mcrod> yes
17:15:00 <mcrod> i shit you not
17:15:00 <heat> poggers
17:15:00 <mcrod> his name is pedro falcato
17:16:00 <mcrod> couldn’t believe it
17:16:00 <heat> what
17:16:00 <heat> fuck off mate
17:16:00 <mcrod> wut
17:16:00 <heat> i need proof
17:16:00 <heat> there's no way
17:16:00 <heat> i've never met someone with my name
17:17:00 <heat> like, ever
17:17:00 <gog> lmao
17:18:00 <gog> pedro falcato
17:18:00 <gog> pedro falcato
17:18:00 <heat> shut up gog
17:18:00 <heat> dont steal my name
17:18:00 <heat> it's mine only
17:19:00 <mcrod> vote for pedro
17:20:00 <heat> do NOT vote for me
17:20:00 <heat> bad idea
17:25:00 <gog> my name is ada
17:25:00 <gog> or is it michael
17:25:00 <gog> or maybe pedro
17:25:00 <gog> ¯\_(ツ)_/¯
17:38:00 <mcrod> it’s pog
18:08:00 <heat>
18:08:00 <bslsk05> ​ Trip report: Summer ISO C++ standards meeting (Varna, Bulgaria) – Sutter’s Mill
18:08:00 <heat> c++26 got RCU and hazard pointers
18:44:00 <Ermine> heat: why didn't you propose banning freebsd or netbsd?
18:58:00 <Ermine> On other news, I'm freaking lucky today
19:03:00 <gorgonical> Holy shit I am so out of sorts I thought it was Wednesday already
19:04:00 <gorgonical> I was thinking "jeez i thought i just went to the gym yesterday, I gotta go again??"
19:10:00 <mcrod> what’s a hazard pointer
19:11:00 <mcrod> and why does google not tell me what RCU stands for
19:12:00 <Ermine> google bad
19:12:00 <gorgonical>
19:12:00 <bslsk05> ​ What is RCU? -- "Read, Copy, Update" — The Linux Kernel documentation
19:13:00 <gorgonical> indeed, google bad, kagi good
19:14:00 <mcrod> also
19:14:00 <mcrod> maybe I just don’t have a lot of multithreaded experience
19:14:00 <mcrod> and, I don’t
19:14:00 <mcrod> but I feel like there’s a *lot* of bullshit around it
19:16:00 <mcrod> in fact I’m actually not sure how you get really deep into the multithreaded world except “write these enormously complicated things that you won’t understand 5 years from now”
19:23:00 <gorgonical> one of my biggest pet peeves for c style is when the braces are omitted for single-statement if-elses
19:27:00 <mcrod> yes
19:28:00 <mcrod> i agree
20:15:00 <heat_> Ermine, because openbsd sucks harder
21:02:00 <geist> gorgonical: oh that rcu link is quite good
21:11:00 <gorgonical> first result on kagi with "linux rcu" even
21:27:00 <netbsduser`> rcu is easy: first you read, then you copy, then you update, then you win
21:28:00 <sbalmos> huh... did reddit just remove the osdev sub?
21:29:00 <nortti> still there for me
21:29:00 <sbalmos> eh, looks like reddit's servers are in a split-brain
21:29:00 <netbsduser`> sbalmos: is that the one where they are "os deving" by lightly modifying the source code of the windows xp source code leak? if so i am not surprised
21:29:00 <sbalmos> no
21:30:00 <sbalmos> it's the one where every other day someone asks "how do I get started writing my own os? I know JS and Python lolz"
21:30:00 <netbsduser`> interesting you mention that
21:31:00 <netbsduser`> the famous fenolossa osdev tutorial now has a warning banner on it
21:35:00 <heat> what's that?
21:35:00 <heat> never heard of it
21:36:00 <heat> geist, paul mckenney's book is also really good
21:36:00 <heat> but in reality what was standardized was the API, not the implementation
21:36:00 <heat> what will almost surely end up happening is epoch-based reclamation will start popping up
21:36:00 <heat> just like facebook's folly RCU implementation (literally implements the C++26 paper, but in folly:: instead of std::)
21:37:00 <heat> will it be any good? who knows, but better than no RCU i bet
21:37:00 <Cindy> fasaboo
21:37:00 <Cindy> bro, who needs C++
21:38:00 <Cindy> when you can actually control the object size in C, unlike C++, where after you link the program to STL, it bloats up to 5 MB
21:38:00 <Cindy> even if you use like one STL function
21:39:00 <heat> ok
21:39:00 <heat> is this going to become a C vs C++ discussion?
21:39:00 <Cindy> sorr
21:39:00 <Cindy> sorry
21:41:00 <heat> np
21:42:00 <heat> i just don't really have the patience for this kind of sillyness really
21:42:00 <heat> really am just discussing RCU
21:43:00 <Ermine> what rcu means in context of the language
21:46:00 <heat> wdym
21:47:00 <Cindy> real context unit
21:54:00 <mcrod> hi
21:54:00 <mcrod> sorry heat
21:54:00 <heat> together we can stop the his
21:55:00 <mcrod> no we can’t
21:56:00 <mcrod> i’m a nice person who says hi a lot
22:01:00 <netbsduser`> heat: a hugely popular osdev tutorial that gets reddit, hackernews, and similar crowds roaring with wonder
22:02:00 <netbsduser`> it had been causing some upset in the osdev discord because of a number of problems with it which would lead the unwary to ask about the exact problems in the discord
22:03:00 <jimbzy> Problems are good, though. That's how we learn.
22:04:00 <sbalmos> the guy's repo with all of the data even has a warning at the top saying it has many bugs and design issues
22:04:00 <netbsduser`> jimbzy: the trouble is when the problems get fundamental
22:04:00 <sbalmos> like a few other "starter libraries" that abuse undefined behavior in C/EFI, are horribly buggy, etc. same questions over and over.
22:05:00 <netbsduser`> for example most osdev tutorials are really "write a bootsector and do some basic x86 initialisation" tutorials
22:05:00 <sbalmos> not to mention people who don't know ${language} /at all/, and keep making boneheaded bit-manipulation errors
22:06:00 <gog> hi
22:06:00 <heat> back in my day we had jamesm's tutorial
22:06:00 <heat> not these fancy pants tutorials
22:06:00 <jimbzy> sbalmos, Bad way to learn a language.
22:06:00 <gog> ah i remember jamesm tutoral
22:06:00 <jimbzy> ya
22:07:00 <sbalmos> jimbzy: no kidding
22:07:00 <gog> mcrod: hi
22:07:00 <sbalmos> jimbzy: they don't know, say, C. they don't understand bit manipulation, assembly, etc etc etc
22:07:00 <mcrod> gog: hi
22:07:00 <netbsduser`> jamesm realised the error of his ways and later plotted to create a teaching kernel which would be an actual kernel
22:07:00 <gog> can i hug you
22:07:00 <jimbzy> Yeah, that's not a good way to get started.
22:08:00 <mcrod> gog: yes of course
22:08:00 <zid> sbalmos: You get this same issue with people trying to 'learn reverse engineering'
22:08:00 * gog hug mcq
22:08:00 <gog> mcrod:
22:08:00 <zid> Like it isn't all applied knowledge
22:08:00 <sbalmos> mm hmm
22:08:00 * mcrod hug gog
22:08:00 <jimbzy> That's pretty much how I learned assembly, zid.
22:08:00 <gog> you learn by doing
22:08:00 * sbalmos puts a plate of gognip over in the corner for gog
22:08:00 <zid> you learn RE by learning C, binutils, windbg, assembly, reading the manuals, etc, not from 'learning RE'. OSdev is very very similar imo, except a couple of algos that are rare outside of it like some memory stuff.
22:08:00 * gog rolls around and sniffs the gognip
22:09:00 <gog> i taught myself everything i know
22:09:00 <jimbzy> I learned how to read it pretty well, and then I started writing little patches.
22:09:00 <netbsduser`> doing is helpful but one of the most important things for most people is to have intimate knowledge of an existing OS
22:10:00 <gog> jk i had problems and asked for advice and found solutions other people did
22:10:00 <heat> openbsd
22:10:00 * heat has been banned from #osdev
22:10:00 <gog> hi
22:10:00 <jimbzy> For that, you need Andy Mininxbaum's books.
22:10:00 <netbsduser`> you can imitate openbsd, but by god, implement a unified buffer cache
22:10:00 <heat> gog has been banned from #osdev
22:10:00 <gog> linux torvald
22:10:00 <heat> netbsduser`, did you know their vfork() is still fake?
22:11:00 <netbsduser`> heat: i didn't, but i am not surprised
22:11:00 <heat> the man page is even written in a dismissive tone
22:11:00 <mcrod> all man pages are
22:12:00 <mcrod> it’s unix
22:12:00 <heat>
22:12:00 <jimbzy> "This shit may, or may not work. I don't know. Try it."
22:12:00 <heat> >Since fork(2) is now efficient,
22:12:00 <heat> lads, we've solved fork(2)
22:12:00 <heat> inefficiency is no more
22:13:00 <netbsduser`> that's right
22:13:00 <heat> and apparently mmaped files and write()/read() don't actually sync up automatically
22:13:00 <netbsduser`> as long as you only go on a texas tlb shootdown massacre and grind potentially gigabytes of address space to set up copy-on-write, you are efficient
22:14:00 <heat> which is ridonculous
22:14:00 <netbsduser`> that's the fault of their lack of a unified buffer cache
22:14:00 <heat> how is that the buffer cache's problem?
22:14:00 <heat> just sounds like a bad page cache to me...
22:15:00 <netbsduser`> it's because the code path for filling the filepage cache accesses the buffer cache
22:16:00 <heat> how does that matter?
22:16:00 <heat> i would expect the page cache to be divided in pages and for mmap to directly map pages
22:16:00 <heat> as such touching them on mmap and/or write() would be the same thing
22:16:00 <netbsduser`> and so if you then modify the file with write(), even after the pages have been mapped shared, if the block you modified belongs to a page that has been faulted in, then the change is not reflected in the file page cache
22:17:00 <netbsduser`> openbsd still uses the traditional buffer cache, which is block-based, for file page contents
22:18:00 <netbsduser`> so the data exists in both the block buffer cache and the file page cache
22:18:00 <netbsduser`> this duplication is why there is incoherence
22:22:00 <heat> i think i kind of understand what you mean
22:24:00 <netbsduser`> it's explained with a helpful diagram in
22:25:00 <heat> oh so the page cache is not even accessed on read/write?
22:25:00 <heat> i see
22:25:00 <heat> it's bizarre
22:26:00 <heat> i don't think you can unsee the unified page cache after seeing it lol
22:49:00 <zid> Does POSIX say anything about how shit should interact btw, specifically stuff like, having two copies of a file open, having one mmaped and one opened, etc, or is it just "idk, the OS does something, glhf"
22:51:00 <heat> it says you may need to msync()
22:51:00 <netbsduser`> zid: almost certainly the minimal of requirements
22:51:00 <zid> m'sync *tips fedora*
22:52:00 <netbsduser`> though it's interesting i've never seen anyone serious suggest that you should assume only the minimal requirements set by posix
22:52:00 <heat> POSIX is useless
22:52:00 <zid> posix seems pretty underspecified in general
22:53:00 <heat> linux is the new UNIX, POSIX is a relic
22:53:00 <zid> and has crappy APIs that can't actually implement useful things for files, like atomicity
22:53:00 <netbsduser`> i just think it's interesting by comparison to e.g. the C standard
22:53:00 <heat> the C standard suffers from the same issue though?
22:53:00 <heat> it's the minimalest of requirements
22:53:00 <zid> C standard doesn't really "suffer" from it though
22:53:00 <zid> because it's *very* minimal to begin with
22:53:00 <zid> so you *know* you're on your own
22:54:00 <netbsduser`> there exists a lobby of people who will suggest that you will and deserve to have your hard drive formatted and your children and wife murdered in brutal fashion for ever stepping beyond it
22:54:00 <zid> posix heavily specifies a lot of complex stuff, but leaves all the subtle interactions unsaid, that's the problem
22:54:00 <netbsduser`> but no such lobby for posix that i know of
22:55:00 <heat> some people do see POSIX as the big goal
22:55:00 <heat> and POSIX certification
22:55:00 <heat> which is silly but to each their own
22:58:00 <mcrod> hey i said that
22:58:00 <heat> you're a big copycat mcrod
23:00:00 <netbsduser`> it's understandable to try to conform to it
23:00:00 <netbsduser`> but to elevate it to scripture and to gleefully delight in lawyering it to catch out the unwary would be bizarre
23:00:00 <netbsduser`> and is not done
23:01:00 <netbsduser`> people spit on the developers of windows for "doing the minimal to be posix compliant", after all
23:03:00 <heat> yes because micro$hit winblowz
23:04:00 <heat> but they wouldn't dare say that to a great UNIX descendent such as OpenBSD
23:04:00 <heat> it's even secure!
23:06:00 <heat> microgarbage winsucks
23:19:00 <zid> windows isn't even bare minimum
23:19:00 <zid> its fwrite/fread have the wrong buffering behavior for posix, it only does C
23:29:00 <netbsduser`> i mean the Windows Subsystem for POSIX Applications
23:29:00 <netbsduser`> though it's gone now
23:30:00 <zid> we have wsl now sorta
23:30:00 <zid> if they ever add proper hyper-v support for amd's vt tech..
23:44:00 <netbsduser`> wsl 2 is a bit boring though
23:44:00 <netbsduser`> >virtual machine
23:45:00 <zid> hey, it's INTEGRATED
23:45:00 <zid> I can copy paste and stuff, and it automounts all my filesystems in both directions
23:45:00 <zid> and I get native windows
23:46:00 <zid> like if I were doing X forwarding
23:46:00 <heat> the giga ideas for WSL1 were truly giga ideas but way too hard