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
Turn_Left has quit [Read error: Connection reset by peer]
dude12312414 has joined #osdev
MiningMarsh has quit [Ping timeout: 250 seconds]
xenos1984 has quit [Read error: Connection reset by peer]
<zid> kazinsal: Hence avx10
<klys> cpuinfo on my epyc3 box lists avx and avx2
SGautam has quit [Quit: Connection closed for inactivity]
xenos1984 has joined #osdev
wblue has quit [Quit: wblue]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[itchyjunk] has quit [Ping timeout: 246 seconds]
smeso has quit [Quit: smeso]
smeso has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<geist> computers! amirite?
Yoofie has quit [Ping timeout: 244 seconds]
Yoofie has joined #osdev
carbonfiber has quit [Quit: Connection closed for inactivity]
<kazinsal> *nods sagely* computers.
<geist> hows your vax been doing?
<kazinsal> a capacitor in the power supply went pop, so I need to tear it down and recap it
<kazinsal> was fiddling around in the monitor one day and suddenly the console went dead and there was the distinctive smell of dead capacitor in the air
<zid> is new vax smoke expensive?
<kazinsal> probably not, I'd expect there's probably only 10-15 caps on the power supply board
<kazinsal> but if something is going bad on the motherboard, it's going to definitely be expensive smoke
slidercrank has joined #osdev
<zid> ah, generic smoke
Vercas has quit [Quit: buh bye]
Vercas has joined #osdev
<geist> yeah that psu in it looks like a beast
<geist> might be pretty interesting to get it open
<geist> i did some surface mount soldering the other day, pretty proud of
<zid> I've seen beefy caps in weird voltages cost like $40/ea
<geist> some 0603 resistor and caps
<zid> so it's not unreasonable that it might cost a lot to fix
<bslsk05> ​swetland/appleii.vga - Apple II VGA PCB (0 forks/6 stargazers/MIT-0)
<geist> swetland sent me one
<geist> so the 0603s are pretty dificil, but got okay towards the end, so now i think i can safely use those for future projects
<geist> though will probably stick to 0805s
frkzoid has quit [Ping timeout: 260 seconds]
<geist> 𝕏 that
<Ermine> wayland social network when
<bslsk05> ​Note by Wayland.social: "Welcome to Wayland.social: the successor to X.com."
goliath has quit [Quit: SIGSEGV]
<Ermine> Nice
<sham1> It does make sense
slidercrank has quit [Ping timeout: 260 seconds]
<Ermine> Someone has also to joke about X-COM
<sham1> If I use X, will I be an x-man?
zxrom_ has joined #osdev
zxrom has quit [Ping timeout: 245 seconds]
goliath has joined #osdev
slidercrank has joined #osdev
benlyn has joined #osdev
benlyn has quit [Client Quit]
benlyn has joined #osdev
GeDaMo has joined #osdev
danilogondolfo has joined #osdev
[itchyjunk] has joined #osdev
andydude has quit [Ping timeout: 250 seconds]
<zid> oh, random fuzxxl encounter in the wild
<zid> he's got the top commenton a random old vid I rewatched
[itchyjunk] has quit [Read error: Connection reset by peer]
<moon-child> remember the good old days
<moon-child> when fuzxxl was just fuzxl
zxrom_ is now known as zxrom
<zid> before he got double fat?
heat has joined #osdev
nyah has joined #osdev
vai has quit [Ping timeout: 245 seconds]
Burgundy has joined #osdev
<kazinsal> staring trying to find out from the worst technical documentation how to implement the 4th edition Unix filesystem
<kazinsal> grr
<GeDaMo> Use the source, Luke?
<sham1> The code is the documentation
<clever> in my case, the code just says use 5682 for 19.2mhz, and no explanation of why, lol
<clever> if i correctly use 5682, i get a SOF interval of 125uSec, 8khz, as the usb specs say
<clever> if i try 5683, i get an SOF interval of ~122.6, 8156khz
<clever> but i cant find a clear linear relationship between those numbers
<Affliction> yay, PLLs?
<zid> so it's not a divisor?
<zid> it looks like one with those two numbers
<zid> 45.464
<clever> 5695 gives 99 uSec or 10101Hz
<clever> 5648 gives 390.8uSec or 2558Hz
<zid> It might have control bits mixed in
<clever> i tried using a bitmask to select the lower N bits, but still no obvious pattern, for every N
<zid> like, it might be bit 3 is a /10, but bit 0-2 are an integer, or such
<clever> and if i go too low (2000, or 5200), it goes completely off the rails
<zid> You'd need to test a fuck load of values imo
<zid> at least, flipping every bit
<clever> yep, thats why i added code to raise/lower the divisor by 1, and report the avg SOF interval
<clever> ive graphed 5648 thru 5695
<clever> and it looks pretty linear so far
<zid> but those all contain the 2048 bit
<clever> yeah
<zid> err 4096
<zid> knowing the base clock would be a cheat too
<clever> 19.2mhz i believe
<zid> solves one of the simultaneous equations in advance
<heat> kazinsal, those filesystems are all horrendous
<heat> they even adjust based on the fucking CPU
<heat> although i looked at v7, but i dont imagine param.h is any less cursed in v4
<clever> zid: hmmm, looking over the numbers again, as this mystery number goes up, the SOF freq also goes up, so its not a divisor, but a multiplier, refclk * mystery == sof_freq
<clever> and behind the scenes, a PLL just implements that as sof_freq(vco)/mystery == refclk, via the PLL
<clever> and that does come out to 159hz refclk, when masking with 63..., but that seems rather slow
<zid> 160 ish yea
<zid> but it might be a selector bit and 4096 is something else, again
<zid> so it's actually like 200 * n not 4200 * n
<zid> which makes it a few khz instead of 160 ish
<clever> 5633 made a huge step, to 44.9 usec or 22,271 Hz
<zid> Time to write a script to boot the pi on all 64ki values and record what happens
<geist> kazinsal: hmm, is it approximately FFS? or some completely different design?
<clever> no need to reboot, i can just change it on the fly
<geist> i forgot when FFS got stamped out
<zid> it might crash? :P
<geist> and dunno if it's based on anything previous
<clever> zid: if i change the mystery number by even +/- 2, i get a transfer error from the usb controller, it was polling an interrupt endpoint
<geist> wikipedia says FFS is roughly based on unix v7 FS so okay
<clever> but it keeps on sending SOF's out at the wrong rate, likely the wrong symbol rate too
<heat> yeah FFS is BSD isn't it?
<geist> 4.2BSD it seems
<kazinsal> what I'm doing is between v4 manual filesystem and 4BSD FFS
<heat> this is remotely cool
<bslsk05> ​docs.google.com: pll control - Google Sheets
<kazinsal> physical structure of a standard classic BSD filesystem but with a much more regressive physical implementation backing it
<clever> zid: column F is the input i put into the hw, and then column E is the interval i measured
<heat> kazinsal, early BSD's filesystem is literally v7's filesystem
<clever> in rows 10/11, there is a very clear step, where it stops being linear, but thats at 0x1603 to 0x1604
Lian has joined #osdev
<Lian> boo
<heat> both of which really are garbage filesystems anyway
Yoofie4 has joined #osdev
<zid> 5 values in a row giving #DIV/0 is strange
Yoofie has quit [Ping timeout: 260 seconds]
Yoofie4 is now known as Yoofie
<zid> You'd expect a power of 2 if any control bits were in there
<heat> also they really liked using octal in early UNIX and fuck that
<clever> zid: those are because i havent measured the SOF interval for those rows
<zid> oh right
<clever> but it does seem like the VCO has bottomed out
<clever> rows 11-14 are all giving the same interval
<clever> which is also visible in the graph near row 70
<clever> at 0x1609, it starts to leave the floor
<clever> zid: hmmm, nothing i do to the numbers, makes any sense out of them
<sham1> heat: octal good
Yoofie has quit [Ping timeout: 264 seconds]
Yoofie has joined #osdev
<clever> zid: at 512, its either not ticking, or too slow to even do 1 usb transfer, at 1024, its ticking fast enough that the interrupt endpoint failed due to the wrong bus rate
slidercrank has quit [Ping timeout: 264 seconds]
joe9 has quit [Quit: leaving]
vai has joined #osdev
Terlisimo has quit [Quit: Connection reset by beer]
slidercrank has joined #osdev
lanodan has quit [Quit: WeeChat 3.8]
lanodan has joined #osdev
<clever> i think i just need some sleep, this is very clearly a linear relationship, but i just cant math at 7am, lol
Terlisimo has joined #osdev
eroux has quit [Ping timeout: 250 seconds]
gog has joined #osdev
eroux has joined #osdev
<gog> hi
eroux has quit [Ping timeout: 244 seconds]
eroux_ has joined #osdev
eroux has joined #osdev
eroux_ has quit [Ping timeout: 264 seconds]
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<zid> omg did you guys hear that elon musk is re-launching X.org
<zid> Wayland sucks, X11 for ever
<zid> (The logo is like, super similar, so I assume he's talking about Xorg)
<nortti> X.com, the corporate fork of X.org
MiningMarsh has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
<Lian> The Xorg mastodon account also suffered a hostile takeover by the freedesktop trolls who now advertise Wayland and talk down to X users.
<Lian> It's quite unsportsmanlike
<nortti> lol
<gog> i can't go back to X, i like not having screen tearing
<gog> sorry
<gog> freesync also does not work at all not even a little
<zid> I'd like to not have tearing too, sadly W10 isn't enough
<zid> It's a little better than W7
<zid> but the dirty rectangles impl is still buggy with overlapping windows
<zid> video players etc behind other windows can cause scrolling the top window to tear
<gog> once again linux beats windows at a thing you think it wouldn't
<gog> SO SAD
<zid> I mean, the problem with linux is that it's a diaspora
<zid> so it might be better, it might be worse
<zid> depends on the day of the week
<gog> my linux
<zid> windows is fairly standardly 60% all of the time
<gog> the linux specific to my configuration
<zid> The things that are broke have been broken since win2k
<gog> my unique special snowflake of an operating system
<zid> Like, you can still move the taskbar while it's locked on w7, they never fixed that throughout its entire lifespan
<sham1> So it's not actually locked
<sham1> What kind of chicanery is that
<zid> it's locked *most* of the time
<zid> but there's some flag issue or race condition or something
<zid> where very occasionally if you click to select something on the taskbar while moving the mouse a few pixels, like you might accidentally do
<zid> the taskbar can get stuck to your mouse
<gog> taskbar glomps mouse pointer
<zid> plus that afforementioned tearing issue
<zid> afformentioned?
<zid> spellig us hurd
<gog> who
<zid> gnu/hurd
<gog> no such thing
<gog> you made that up
<zid> gnu/gnu
<zid> bison/hurd, flex/gaggle
<zid> yacc/windows
<sham1> hotel/trivago
<Lian> brille/fielmann
<gog> cool pronouns
<Lian> i have the coolest pronouns
<Lian> in the whole wide world
<gog> cool/cool ?
<Lian> nah
<Lian> idk actually
<gog> valid
<zid> My pronouns are the entire contents of war and peace, and "him"
<Lian> if the entire contents of war and peace feels that is right for him, of course i support him
<zid> you can shorten the war and peace part to "he" though, it's short for 'pierre bezukhov'
<zid> I'll know whether you meant it as 'war and peace but abbreviated' or 'he' when you say it aloud, so make sure you think really hard about war and peace while you say it
heat_ has quit [Read error: Connection reset by peer]
<zid> For bonus points, shoot someone in a duel and join the freemasons
heat_ has joined #osdev
<gog> i already did that
xenos1984 has quit [Read error: Connection reset by peer]
<sham1> Instructions unclear, joined FreeDOS instead
<zid> gog: That's because you're a friendly person
<zid> sham1 over here always gets my pronouns wrong on purpose to spite me, hasn't once shot anybody in a duel
<bslsk05> ​'A bit of fry and Laurie -Derek N-i-p-p-l-/e' by HughLaurieFanGR (00:03:30)
<Lian> SerenityOS/Hurd when
SGautam has joined #osdev
<SGautam> What is wrong with cmd lmao
<SGautam> sending \b to cmd.exe causes it to delete the whole word instead of the last character.
<sham1> I'd be willing to fund a GoFundMe to have Andreas do that
<SGautam> sending \x7F works as normal
<SGautam> bruh
<zid> cmd just never tried to emulate vt100, it just does whatever it wants
<zid> via some dos heritage, and some "developers tend to remember things sometimes from elsewhere and accidentally steal them"
<SGautam> wait am I doing this wrong
<SGautam> When I get a SDL_BACKSPACE event, I just send \b
<zid> again, this is why ncurses exists, so you can get portable crap
<SGautam> Should I send ESC ^H or something
<SGautam> Nah that doesn't work.
<SGautam> Damn, I might have to add a check for cmd.exe specifically
<zid> you're rewriting ncurses? gj
<zid> what about SetConsoleMode
<zid> ENABLE_PROCESSED_INPUT or whatever
<sham1> What about abandoning Windows
<SGautam> zid: I'm writing a terminal emulator for Windows
<SGautam> sham1: how will I show off my Win32 skills to the employers?
<SGautam> lol
<zid> then what does cmd have to do with anything
<sham1> Probably running cmd inside their own emulator to show off
<zid> but that's wine, not a terminal
<zid> a terminal emulator can't 'run cmd'
<zid> that's like saying you use xterm to run Terminal from xfce4
<SGautam> More like linking a pipe between cmd.exe and my program to render cmd.exe's output and send messages to cmd.exe.
<zid> So you mean, CONHOST emulator
<zid> (which is not a VT-100, so yea, will need different stuff)
<zid> conhost compatible terminal? whatever
<SGautam> I mean, even Microsoft has abandoned cmd
<zid> yup, it's shit
<SGautam> Powershell is fully ANSI compataible.
<sham1> Powershell
<zid> conhost is shit, mainly though
<zid> which makes cmd shit by default
<SGautam> but it's got its own shenanigans
<zid> The new one is 'conpty'
<SGautam> touch myfile.txt vs New-Item myfile.txt
<zid> I hate powershell's builtins, but it's a nice-ish piece of software
<SGautam> mkdir? Nah, New-Item -ItemType=Directory
<zid> it has tab complete and stuff at least
<SGautam> but you can make it bearable by creating aliases.
<zid> (cmd has tab complete but it's very easy to break, files with [ in them etc)
<zid> CreatePsuedoConsole is the new api apparently
heat__ has joined #osdev
heat_ has quit [Remote host closed the connection]
<SGautam> ooooooh
<SGautam> I have not even set ENABLE_VIRTUAL_TERMINAL_PROCESSING to true
<SGautam> kek
xenos1984 has joined #osdev
<SGautam> I don't know how its even working for so long.
<zid> You're welcome
<zid> That will be $80
<zid> Per character processed.
<SGautam> lol
<SGautam> Well, this is interesting 0x7F seems to be the correct sequence to send that works for both CONHOST and WSL.
<zid> That is ascii DEL afaik?
<zid> what does 0x8 do?
<SGautam> 0x8 is BS
<SGautam> backspace
<zid> yes, what does it do
<zid> I didn't ask what ^H *was*, I just wanted to know why are aren't using it
<SGautam> Erase character and move a position back?
<SGautam> That's what \x8 does.
<SGautam> I think most shell programs expect ASCII DEL as opposed to backspace character which they print out to their standard output otoh.
<SGautam> When the user hits a backspace.
<zid> > I didn't ask what ^H *was*, I just wanted to know why are aren't using it
<zid> you've explained what it is twice now
<zid> and why we're not using it 0 times
<zid> which is a very strange reply to the exchange of "DEL seems to work" "What about BS?"
<SGautam> Hm, I get you, yeah I have no idea.
<gog> hi
<zid> henlo gug
<zid> Can I have a battered sausage
zxrom has quit [Remote host closed the connection]
zxrom has joined #osdev
heat has joined #osdev
<gog> yes
* gog gives zid a battered sausage
heat__ has quit [Read error: Connection reset by peer]
<froggey> let vid = virtio_mmio.vendor_id(); let did = virtio_mmio.vendor_id();
<froggey> i am very smart
<gog> hi froggey
<gog> you are v smart
<froggey> hi gog
<froggey> thank you
<froggey> you are too
<gog> nah
gareppa has joined #osdev
<gog> i'm just a gal who tries too hard
<Lian> Theres smart people here?
<Lian> Damn
heat has quit [Ping timeout: 244 seconds]
heat_ has joined #osdev
<gog> couldn't be me
<jimbzy> Shop smart. Shop S-Mart.
Lian has quit [Quit: This Konversation is over!]
heat_ has quit [Read error: Connection reset by peer]
heat has joined #osdev
eroux has quit [Ping timeout: 244 seconds]
eroux has joined #osdev
andydude has joined #osdev
<sham1> 0/10, not enough nuke
<zid> Don't spoil the ending
<heat> what's your favourite linux kernel file
<zid> bzImage
<heat> bruh
<heat> bzImage is bzCringe
<heat> vmlinuz!
<zid> I have never booted a vmlinuz
<heat> vmlinuz and the z stands for zombocom
<heat> anything is possible
<heat> wait zid what compression method do you use for the kernel?
<zid> bzImage is all I have booted
<heat> but is it actually bz?
<zid> I cp it from arch/x86_64
<zid> it says bzImage
<zid> boot/ in there somewhere
andydude has quit [Ping timeout: 240 seconds]
<heat> that doesn't mean anything
<heat> grep for CONFIG_KERNEL_ in your config
<zid> what does it do by default
<heat> i don't know
m5zs7k has quit [Ping timeout: 264 seconds]
<zid> gzip
<zid> apparently
<zid> it still names it bzImage though
<heat> your bzImage is a fake!
m5zs7k has joined #osdev
<zid> file says it's a bzimage, good enough
<zid> It starts MZ though cus.. efistub
<heat> arm64 dropped the bz, it's just Image
<zid> wow, disgusting
<mjg> xzImage111
<heat> tbf they also dropped compression soooo
<mjg> lmao arm too slow to dekomprez
<heat> hello mjg my favourite freebsd developer
<mjg> amirite
<mjg> ey fuck off
<mjg> non-stop hazing
<heat> does freebsd decompress itself
<mjg> your mom is decompressed down below if you know what i men
<zid> is there even any point in it being compressed anymore
<heat> :/
<mjg> i don't know if that entire kernel compression business makes any sense for years now
<zid> we're not on shitty PATA hdds
<heat> not really, hence why they dropped it
<mjg> and i'm not particuarly convinced it ever did
<zid> oh they dropped it being compressed too?
<mjg> well apart from booting from a floppy
<heat> arm64 and riscv do not support it
<heat> yep
<zid> You just said they dropped bz from the name
<heat> no, they dropped both
<zid> yea I get that now
<mjg> arguably that name is not good
<zid> I was saying you had only previously said they removed it from the name
<zid> we're going in feckin circles
<mjg> image of what
<mjg> and besides i'm pretty sure it was gzip
<mjg> so gzImage? :
<mjg> linukkz thinking ahead innit
<heat> i have a zstdImage
<heat> because i'm cool and modern
<mjg> well i have base64Image
<heat> uuImage
<heat> just completely uuencoded
<zid> hah
<zid> uuImage with parity is what I want
<zid> wait, par2Image
<mjg> hm now i'm curious hwo separate /boot came to be on linux
<mjg> was it because the kernel kept fucking up ext2 :d
<heat> wasn't it the same on l'UNIX?
<mjg> good ol unix had a file in /
<mjg> vmunix or something
<mjg> and that was ze kernal
<heat> yeah but / was separate from /usr innit
<mjg> in fact old school netbsd still rolls with it (except they have /netbsd)
<mjg> that split came later
<mjg> and i think so does OPENBSD
<heat> oh where does genunix come to play?
<mjg> i dn't remember where slowaris keeps it
<heat> is unix vs genunix just a sunos/solaris thing?
<mjg> they have some seriously weird stuff over there
<mjg> where is your kernal
<mjg> /lolboot/onyx?
<zid> genunix is gentoo portage for sus
<mjg> general unix, a good friend of general sanders
<heat> /boot/vmonyx
<mjg> move it up to /
<mjg> you are doing a half-measureo n this one
<heat> no, that's for people over 60yo
<zid> heat when are you porting portage toonyx
<mjg> i thought that's what you are larping by writing a unix clone
<heat> zid, what's portage written in?
<mjg> vmleen00kkzzz
<mjg> sweat and tears heat, sweat and tears
<heat> linux kernel operating system linux kernel peratong system
<heat> ntoskrnl.exe is better anyway
<mjg> funny you say that i'm watching a video with some guy wearing a windows logo shirt
<mjg> i was triggered at first
<mjg> when i was in high school and actively fighting linukkkz vs windows
<mjg> i ran into a guy who claimed that it is too much work to write an operating system by some volunteers
<mjg> consequently linux has to be using stolen windows code
wgrant has quit [Ping timeout: 245 seconds]
<zid> python sadly
<heat> i agree
<zid> https://www.youtube.com/watch?v=ntd4FPQJX1w this is good osdev music
<bslsk05> ​'Full We Love Katamari OST' by F4m1LyGuy10 (01:21:03)
<mjg> i only heard of python 2 and 3
<mjg> is 'sadly' a codename for a nwe version
<mjg> :rimshot:
<heat> yes
<mjg> is this the one guido promised would be fast?
wgrant has joined #osdev
eroux has quit [Ping timeout: 245 seconds]
goliath has quit [Quit: SIGSEGV]
frkzoid has joined #osdev
eroux has joined #osdev
basil has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
basil has joined #osdev
[itchyjunk] has joined #osdev
tomaw has quit [Remote host closed the connection]
tomaw_ has joined #osdev
tomaw_ is now known as tomaw
slidercrank has quit [Ping timeout: 244 seconds]
SGautam has quit [Quit: Connection closed for inactivity]
Left_Turn has joined #osdev
Lareina has joined #osdev
goliath has joined #osdev
vdamewood has joined #osdev
janemba has quit [Read error: Connection reset by peer]
andydude has joined #osdev
bgs has joined #osdev
heat has quit [Read error: Connection reset by peer]
TheCatCollective has quit [Quit: Meow Meow Meow Meow Meow Meow Meow Meow]
heat has joined #osdev
<heat> mjg, i'm trying to port dtrace but gosh darn what the fuck this is so confusing
TheCatCollective has joined #osdev
<mjg> lmao
<mjg> why dtrace
<heat> because the linux bpf ecosystem is a whole other can of worms
* gog bpfs on the floor
janemba has joined #osdev
<heat> mjg, also clearly windoze could port dtrace so it has to be portable, somehow
<heat> * This is a bag of dirty hacks to keep things compiling.
<heat> fuck yeah
Lareina has quit [Changing host]
Lareina has joined #osdev
Lareina has quit [Quit: WeeChat 3.8]
Lareina has joined #osdev
Burgundy has quit [Ping timeout: 244 seconds]
<mjg> heat: this is so much work, and so not rewarding (so to speak) i genuinely suggest you don't do it
<mjg> there is liek 0 growth here to be made
<mjg> you may as well do something paid
<heat> why is it so much work?
<mjg> you need to implement quite a bit of solaris compat layer
knusbaum has quit [Quit: ZNC 1.8.2 - https://znc.in]
<heat> the opensolaris bit isn't a lot
gareppa has quit [Quit: WeeChat 3.8]
<mjg> while ((end_size = zp->z_size) < zfs_uio_offset(uio)) {
<mjg> (void) atomic_cas_64(&zp->z_size, end_size,
<mjg> zfs_uio_offset(uio));
<mjg> }
<mjg> ASSERT(error == 0 || error == EFAULT);
<mjg> lmao
knusbaum has joined #osdev
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
MiningMarsh has joined #osdev
vdamewood has quit [Remote host closed the connection]
vdamewood has joined #osdev
Lareina has quit [Quit: WeeChat 3.8]
Lareina has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
<heat> gosh this is annoying
<heat> i'll roll my own
<mjg> ey heat
<mjg> static void
<mjg> {
<mjg> tid = (uintptr_t)curthread;
<mjg> dtrace_debug_lock(int cpu)
<mjg> uintptr_t tid;
<mjg> spinlock_enter();
<mjg> while (atomic_cmpset_acq_ptr(&dtrace_debug_data[cpu].lock, 0, tid) == 0) /* Loop until the lock is obtained. */
<mjg> ;
<mjg> }
* mjg says lmao
<heat> all of this is just hacks on top of hacks
<mjg> naa
<mjg> your attitude is unbecoming
<mjg> lmao a file straight up named dtrace_hacks.c
<mjg> curious it's not the entire thing in there innit
<mjg> mutex_enter(&cpu_lock);
<mjg> mutex_enter(&dtrace_provider_lock);
<mjg> mutex_enter(&dtrace_lock);
<mjg> jesse we need to go faster
Lareina has quit [Quit: WeeChat 3.8]
Lareina has joined #osdev
Lareina has quit [Client Quit]
Lareina has joined #osdev
<mjg> for (;;) {
<mjg> while ((lock = *lockp) & 1)
<mjg> if (dtrace_casptr((volatile void *)lockp,
<mjg> continue;
<mjg> (volatile void *)lock, (volatile void *)(lock + 1)) == (void *)lock)
<mjg> break;
<heat> waltuh
<mjg> }
<mjg> even spinnier
<heat> we need locks waltuh
<mjg> what are tehse people smoking
<mjg> or is this one of the famed dangers of inbreding
<heat> whatever you do
<heat> do NOT open opensolaris_atomic.S or .c
<mjg> i had already seen it
<mjg> my innocence is all fucked man
<mjg> check htis out
<mjg> ENTRY(dtrace_membar_producer)
<mjg> rep; ret /* use 2 byte return instruction when branch target */
<mjg> END(dtrace_membar_producer)
<mjg> /* AMD Software Optimization Guide - Section 6.2 */
<mjg> i have an even better optimization for this cpu: #define dtrace_membar_producer
<heat> https://www.youtube.com/watch?v=RjKctkOUjZY you and whoever wrote this code
<bslsk05> ​'Breaking Bad - Talking With Ted Scene (S3E4) | Rotten Tomatoes TV' by Rotten Tomatoes TV (00:02:42)
<mjg> but heat, solaris is a multicore powerhouse
* geist yawns
<geist> morning folks
<heat> hi geist
<mjg> hey geist, i'm casually shitting on solaris. how you doin
<heat> mjg, rep ret scales perfectly
<geist> no doy
<geist> can we not?
<mjg> is reppety rep a 0 cost abstraction?
<geist> check the AMD software optimization guide
<heat> it's a negative cost abstraction!
<geist> there was some period there where rep ret was defacto for AMD cores
<mjg> i'm gonna check rust optimization guide
<geist> see 'use 2 byte return when branch target'
<geist> i remember compilers emitting that for a long time
<mjg> > you are literally faster for using rust
<mjg> aight
<heat> you know what really hurts?
<heat> their assembly indentation
<geist> dont think it's the case anmore, but i think it was a thing back in the k8 days
<heat> ENTRY(atomic_add_64_nv)
<heat> mov%rsi, %rax// %rax = delta addend
<heat> xaddq%rsi, (%rdi)// %rsi = old value, (%rdi) = sum
<heat> lock
<heat> addq%rsi, %rax// new value = original value + delta
<heat> ret
<geist> also iirc sun's x86 hardware they shipped was primary AMD
<mjg> uh mate
<heat> IRC doesn't make justice to how horrendous this looks
<geist> heat: that seems pretty nice
<mjg> maybe it looked better on a sun-branded monitor
<geist> to be honest
<geist> i just dont care to put that much effort into lining things p in asm
<bslsk05> ​github.com: opendtrace/sys/common/atomic/amd64/opensolaris_atomic.S at master · opendtrace/opendtrace · GitHub
<heat> this is puke-worthy
<mjg> lay off heat
<geist> heat: yeah? looks fine to me
<geist> only weird thing is the ENTRY being tabbed over
<geist> a bit of a weird style, but seems pretty readable to me
<heat> everything is tabbed, except for that 1:
<geist> sure
<heat> and then lock being in its own line... yeah, not me
<mjg> beats gnu
<geist> i've seen *far* worse. yeah was about to say gnu
<heat> gnu assembly?
<mjg> i think separate line stems from lock prefix being compiled out for UP
<mjg> so was handier to ifdef
<heat> gnu assembly is pretty ok if you ever get to the assembly
<geist> yeah prefix on its own line makes sense
<geist> i dont care enough to do it, but i think it's kinda reasonable
<geist> that's a leading tab too, so if you're using 4 or 2 space on your screen it wont look as far
<heat> the aarch64 one looks a lot better
<heat> but that's freebsd code
<mjg> we don't say positive stuff abougt freebsdh ere
<heat> this mjg guy is super cool
<mjg> that's not a freebsd statement mofo
<heat> all freebsd developers are cool and none of them use linux
<mjg> s/freebsd/netbsd/; s/linux/it/
<mjg> true story
<heat> s/cool//
<heat> mjg, can lock dec ever be faster than cmpxchg?
<heat> glibc uses it, and they even use it with decl
<heat> there's a universe in which pthread_spin_lock accidentally fucks you over and it takes around 0xffffffff lock decl iterations to do it
<mjg> depends on what they cmpxchg on
<mjg> or decl
<heat> it's just a stupid test-and-test-and-set spinny
<mjg> you mean for unlock
<mjg> why would they lock dec a spinlock
<mjg> is this a rw spinlock?
<heat> cuz the init value would be 1
<mjg> but you can safely unlock with mere store of 0
<mjg> unlocked
<heat> /* Not needed. pthread_spin_init is an alias for pthread_spin_unlock. */
<heat> cry.gif
<mjg> and release fence is free
gareppa has joined #osdev
<mjg> unless they fuck with the value elsewhere
<mjg> ENTRY(pthread_spin_unlock) movl $1, (%rdi) xorl %eax, %eax retq
<mjg> END(pthread_spin_unlock)
<mjg> 's what i see
<mjg> looks legit
<heat> see the _lock
<mjg> what?
<bslsk05> ​elixir.bootlin.com: pthread_spin_lock.S - sysdeps/x86_64/nptl/pthread_spin_lock.S - Glibc source code (glibc-2.37.9000) - Bootlin
<mjg> huh
<heat> i guess it's REALLY hard for this to crash as you'd need around 4 billion threads (and pid limits would fuck you here)
<heat> but, erm, it just horrendously off
<heat> just looks*
<mjg> ye that's... weird
<mjg> but it does ultimately work as they store 1 to unlock
<mjg> i can't think of any legit reason to do it
<heat> pre-pentium compat? but this is x86_64...
<heat> sorry, pre-486
<mjg> even pause is opencoded
<mjg> this is probably VERY old
<mjg> more imoprtantly tho, it literally always spins?
<mjg> does not even yield
<heat> well, yes, that's a spinlock for you
<mjg> i think the freebsd variant gives up at some point
<mjg> you get cmpxchg in _trylock
<mjg> it loogs ugly af because their unlocked state is 1, not 0
<mjg> wait, there are no pthread read-write locks?
<mjg> pthread_rwlock_rdlock there i go
<heat> there are
<mjg> lmao
<mjg> takign a spinlock to bump reader count
<mjg> this is the classic "why are you even doing this" rw lock
<mjg> interesting that gnu manpages don't mention the routine to begin with
<mjg> at least on my ubuntu
<heat> yeah mine don't either
<heat> they fallback to 3P
<mjg> hue
<mjg> freebsd has the cmpxchg loop solaris-style
<mjg> throw away the value returned by the instruction and do an explicit read again
<heat> yeah musl does too
<mjg> i wonder who pioneered this anti-pattern
<heat> ted beneke
<mjg> - are you familiar with my locks?
* gog locks
<mjg> - i'm told they are impeccable
<mjg> - they are the purest, most scalability-sound locks on the market
Burgundy has joined #osdev
* geist sends the lockpicking lawyer at em
<mjg> there is also the kind which recommends slapping in a pause in the loop
xenos1984 has quit [Ping timeout: 246 seconds]
<mjg> maybe ishould ask chatgpt
<geist> i'd tend to think user space spinlocks would generally want a pause yeah
<geist> if it has to loop of course, fast path being not to
xenos1984 has joined #osdev
<mjg> i meant for caes like this
<mjg> while (!(state & wrflags)) {
<mjg> if (__predict_false(URWLOCK_READER_COUNT(state) ==
<mjg> URWLOCK_MAX_READERS))
<mjg> return (EAGAIN);
<mjg> if (atomic_cmpset_acq_32(&rwlock->rw_state, state, state + 1))
<mjg> return (0);
<mjg> state = rwlock->rw_state;
<mjg> }
<mjg> where you just try to bump
<geist> ah, can you get a pastebin?
<mjg> pause between failed attempts fucks perf
<mjg> well i refer you to that lockref debacle
<heat> happy birthday mr president... of sun microsystems
* geist nods
<mjg> tl;dr don't pause if you are trying to atomically bump/dec
<mjg> gg
<bslsk05> ​grok.dragonflybsd.org: thr_umtx.h (revision 4d846d26) - OpenGrok cross reference for /freebsd/lib/libthr/thread/thr_umtx.h
<mjg> extra points for this loller being *inlined*
<mjg> that's some 10% pure code
<mjg> faster motherfucker
<Bitweasil> Ew. I just tried the zenbleed demo on a few of my boxes that are vulnerable CPUs. That's terrifying to watch in action.
slidercrank has joined #osdev
<geist> was thinking, i guess if you disable SMT it should be pretty clear right? or can you still read stale register data out of the register file from some previous context switch?
<heat> they say disabling SMT makes no difference because all cores share the register pool thingy
<geist> except they dont, the register file is shared between threads, the cores are still separate from each other
<Bitweasil> Context switch can leak.
<Bitweasil> A lot less than HTs, though.
<geist> yeah must be context switch leaking
<Bitweasil> And there's a chicken bit you can use to disable the stuff.
<geist> right, we were looking at it at work yesterday. it's still undocumented precisely what it does, even in the non public PPR
aws has joined #osdev
goliath has quit [Quit: SIGSEGV]
<geist> but that particular MSR (0xc0011029 iirc) has other chicken bits in it for other workarounds
<mjg> for fuchsia you probably want to just enabled it for the time being
<geist> yep
<mjg> no point digging into the ordeal
<geist> probably just all fam 17h. it seems to not be for fam 19h and above
<Bitweasil> I enjoy the kernel drama over the name of it.
<heat> where?
<geist> i'll put in a change for it today
<heat> i like drama
<Bitweasil> "Can we rename it boring things?" "No. You didn't help in the slightest with the original work, when you knew what it was."
<bslsk05> ​www.phoronix.com: Linux Kernel Drama: AMD's Spectral Chicken - Phoronix
<geist> well there's a CVE for it at least
<heat> oh yes
aws has quit [Client Quit]
<bslsk05> ​lore.kernel.org: Re: [PATCH] x86/CPU/AMD: Rename the spectral chicken - Peter Zijlstra
<Bitweasil> That's the spicy response. I like it.
<geist> the later change of course is post some particular microcode version you dont need to set the bit
<Bitweasil> I just updated a box with a BIOS and microcode, and it's still leaking.
<Bitweasil> Per the POC.
<heat> i think the current microcode is already fixed?
<heat> at least the one in linux-firmware
<geist> i thought it wa sonly fixed on a particular EPYC
<Bitweasil> I had to set the chicken bit to get it to stop showing things, though I'm not sure the leakage was actually *leakage* or if it was just flag values.
<geist> saw some table just a whiel ago on some article
<Bitweasil> A lot of SCSCSCSCSCSC stuff.
<mjg> ye
<Bitweasil> And " 0 0 0 0 0..."
<mjg> i think they are not giong to fix it on zens until the end of the year
<geist> the rest of the microcode fixes for ab unch of the desktop stuff are coming more like dec 2023
<mjg> ye that
<geist> yeah. they fast pushed it for EPYC romes i think
<heat> why?
<geist> becuase those really matter
<heat> this is like, erm, super serious
SGautam has joined #osdev
<Bitweasil> Oh, I didn't realize the fix wasn't for desktop chips.
<geist> but also may be something like they have more microcode
<Bitweasil> WTF, AMD...
<bslsk05> ​lore.kernel.org: Re: [PATCH] x86/CPU/AMD: Rename the spectral chicken - Borislav Petkov
<mjg> great thread indeed
<geist> i remember some folks at work bitching that the main problem with earlier zens is they dont have enough microcode space, so they quickly ran out of space
<Bitweasil> "Pouring out any memory copied to anyone who looks" is a problem.
<Bitweasil> Huh.
<Bitweasil> So, what if we just turn all the computers back into the sand they came from...
<heat> geist, new zen gens are getting way larger microcode
<geist> right, i dont remember if that started with zen 3 or whatnot
<heat> they recently increased the microcode updating code in linux to have a 2-3x larger buffer
<geist> also still curious why zen 3+ doesn't seem to be affected. did this particular piece get reimplemented differently?
<geist> presumably they didn't fix it in the design explicitly, or they would hve already knowna botu it
<geist> though i assume someone is furiously trying to reproduce this on other zens and intel hardware
<geist> wouldn't be surprised if we dont see it show up elsewhere soon
<mjg> personally i'm waiting for a slew of new vulns here
<heat> i'd say google already tried?
<geist> it's one of these in retrospect this is probably an easy bug to make
<mjg> after cheap attempts someone is gonna fuzz
<heat> it's not like they only fuzz ryzen chips
<mjg> instead of mining bitcoin
<geist> yeah these sort of things tend to trigger a new wave of folks
<Bitweasil> Indeed.
<Bitweasil> You crack open the new box of goodies.
<Bitweasil> And it takes a while to rummage around and see what's in there.
<geist> good ol proper risc: you want to zero the register? zero them yourself dumbass
<Bitweasil> And this one is architecturally visible misbehavior.
<geist> aint no magic instruction for you
<Bitweasil> Which is interesting.
<bslsk05> ​marc.info: '[PATCH] Revert "page cache: fix page_cache_next/prev_miss off by one"' - MARC
<geist> reminds me i need to start adding vector context switch to zircon
<geist> kinda a chicken and egg, not much is using it in user space yet, since no real hardware exists with vector 1.0
<geist> i think linux only really recently got it
<geist> (on risc-v that is)
<heat> according to #riscv it's not really a solved problem yet
<geist> oh the linux csw?
<geist> shit i can beat em to the punch!
<heat> csw?
<geist> context switch
<heat> oh yeah they have support for it, but detection from userspace sucks
<geist> yeah gotta do the whole instruction trapping thing
<geist> if you want it lazy
<heat> you can't go by the misa string, because that doesn't mean the kernel supports it
<geist> oh that, yeah.
<Bitweasil> Man. I wouldn't write a lazy context switcher without the plumbing to make it a real scrub of data on short notice.
<geist> well, we haven't really solved that in zircon either, passing the misa string through
<heat> and then you can't go by their new feature thing, because apparently it's opt-in/out with a prctl
<Bitweasil> Everything seems to leak enough that a lazy switch is risky.
<geist> for riscv even with a hyper superscalar design there's just not that much state to leak, so its probably safer for a while
<heat> RIIIIIIIISCVVVVVVVVVVVVVVVVVVVVV
<geist> you can get the ARM64 style 'read a supervisor MSR and get data from it'
<heat> RUST RISCV RUST RISCV RUST RISCV
<geist> and of course any of the classic meltdown style page table leaks i guess
FreeFull has joined #osdev
DoubleJ has joined #osdev
DoubleJ has quit [Client Quit]
DoubleJ has joined #osdev
slidercrank has quit [Quit: Why not ask me about Sevastopol's safety protocols?]
DoubleJ has quit [Client Quit]
DoubleJ has joined #osdev
DoubleJ has quit [Client Quit]
DoubleJ has joined #osdev
<geist> you know i do wonder why no one has decided it's a good idea to add a unused-page-zeroer to linux/etc again now that it spends a lot of times running in a VM
<geist> i guess maybe the idea is if you want to return pages to the VM the VM implements a balloon thing
<geist> and it's more explicit
<heat> what's an unused-page-zeroer?
<heat> like the idle loop thing?
<geist> zero out pages that are free
<geist> so that the VMM can reclaim the pages as being zeroed
<heat> yeah right i still think there are no wins there though? no idea if the measurements were done under a VM though
<geist> used to be a thing that OSes generally did, but over time it became more efficient to zero-on-demand
<geist> and of course most modern systems dont tend to have a lot of free memory at any one time
<heat> triggering KSM is hella-expensive so I assume it won't be done that much
<heat> actually, i dont know if linux replaces pages with the zero page outside of KSM
<gog> nyaa mrrp meow prr
<gog> ω̈
<heat> gog
<heat> gog
<heat> gog
<gog> hi
<heat> hi
<gog> imagine using memory
<heat> i do nto use mem
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bgs has quit [Remote host closed the connection]
<Ermine> gog: may I pet you
awita has joined #osdev
<gog> Ermine: yes
<gog> using memory is cringe
* Ermine pets gog
* gog prr
Brnocrist has quit [Ping timeout: 245 seconds]
<geist> yah i use KSM on my VM box
<geist> actually works fairly well
CaCode has joined #osdev
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
FreeFull has quit []
<heat> yoooooooooooooooooo
<heat> did you see intel APX?
<heat> x86 is getting 32 registers!!
<bslsk05> ​www.intel.com: Advanced Performance Extensions (APX)
<heat> "The new GPRs are XSAVE-enabled, which means that they can be automatically saved and restored by XSAVE/XRSTOR sequences during context switches. They do not change the size and layout of the XSAVE area as they take up the space left behind by the deprecated Intel® MPX registers."
<heat> hmmmmmm
<heat> something something hardware task switching
<nortti> < heat> did you see intel APX? ← https://en.wikipedia.org/wiki/Intel_iAPX_432
<heat> yep
<heat> unfortunate naming
<nortti> I do love the idea of a new prefix for specifying a third operand
FreeFull has joined #osdev
andydude has quit [Quit: Leaving.]
<heat> Intel® APX demonstrates the advantage of the variable-length instruction encodings of x86 – new features enhancing the entire instruction set can be defined with only incremental changes to the instruction-decode hardware. This flexibility has allowed Intel® architecture to adapt and flourish over four decades of rapid advances in computing – and it enables the innovations that will keep it thriving into the future.
<heat> aka SUCK IT RISCV AND ARM
gareppa has quit [Quit: WeeChat 3.8]
meisaka has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
meisaka has joined #osdev
<moon-child> those are already variable length though
<moon-child> FUUUUUUUUUSION
<moon-child> MOVPRFX
<moon-child> anyway, this is basically x86 adding risc
heat21 has joined #osdev
<moon-child> what's risc? 32 gprs, 3-address, load-store, fixed-size instructions
<moon-child> x86 no has 32 gprs, 3-address, load instructions and store instructions
<moon-child> and, uh, some of the instructions are the same size as each other
<heat21> i dont see how this is risc
<heat21> i do see how this is POGGERS
heat has quit [Killed (NickServ (GHOST command used by heat21))]
heat21 is now known as heat
<moon-child> risc means 32 gprs, 3-address, load-store, fixed-size instructions. i don't make the rules
<heat> what's 3-address
<nortti> 3 memory addresses specified per instruction
<nortti> e.g. subleq
<heat> that reminds me of that subleq fella
<moon-child> ty nortti
<heat> hahaha
<bslsk05> ​forum.osdev.org: OSDev.org • View topic - Dawn
<moon-child> you don't understand heat it's SIMPLE
<kazinsal> the subleq people have some kind of disease
<moon-child> you just don't appreciate SIMPLICITY
<kazinsal> clearly. I own a vax
<nortti> I do personally appreciate subleq the same way I appreciate brainfuck or underload (my favourite esolang ever probably), but I'd never try to build anything more involved on top of it
<heat> The internet, global forum of the free speech - actually controlled by the ISP-s and governments. A wifi device is driven by 5 million of source code lines, and nobody actually fully understants, how they work, a TCP stack is 500.000 lines of code. There are no experts at this area any more - even professionals are just typing random things in
<heat> consoles to get it working if something is broken, hoping that it will randomly cure itself, becouse they cant debug 30 and 40 million code lines that is responsible for sending a bit on the cable.
<heat> amen brotha 💯💯
andydude has joined #osdev
<heat> "since dawn runs in an emulator at the moment, and subleq have no multiplier units to render the gui more quicker, antialiasing at the moment canot be enabled."
<heat> bhahaha haha this thread was peak osdev forums
<sham1> Good grief, wsl just doesn't want to do its stuff
<sham1> Mildly annoying
SGautam has quit [Quit: Connection closed for inactivity]
awita has quit [Remote host closed the connection]
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sebonirc has quit [Remote host closed the connection]
Brnocrist has joined #osdev
sebonirc has joined #osdev
andydude has quit [Quit: Leaving.]
danilogondolfo has quit [Remote host closed the connection]
xenos1984 has quit [Ping timeout: 258 seconds]
foudfou has quit [Ping timeout: 240 seconds]
xenos1984 has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
foudfou has joined #osdev
Burgundy has quit [Ping timeout: 245 seconds]
benlyn has quit [Ping timeout: 258 seconds]
gog has quit [Quit: byee]
nyah has quit [Quit: leaving]