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
JTL is now known as JiTtLe
gog` has joined #osdev
gog has quit [Read error: Connection reset by peer]
<heat> ok dell didn't bother adding S3 suspend support to a $2000 laptop
<heat> this is fucking
<heat> amazing
<mrvn> heat: you spend $2000 and now you want to not use it? Get real.
<heat> it runs fucking hot with the lid closed
<heat> it never suspends
<heat> this is so insane
<heat> I feel sorry for people who bought one of these laptops with their money
<bslsk05> ​'Buying a PC With Dell: My Journey Into Hell' by Super Eyepatch Wolf (00:35:03)
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
SpikeHeron has quit [Quit: WeeChat 3.5]
<gog`> imagine spending $2000 on a laptop
<gog`> i only spent half that
<gog`> shoulda got lenovo breh
SpikeHeron has joined #osdev
<geist> yah get a mac if you're gonna spend that much
<heat> this is a work laptop
<heat> I didn't actually get to choose
<geist> ah yeah the last dell laptop i had was a work laptop. was a piece of crap
<clever> a lot of my dads work laptops where dells as well, and i got handed the used ones
<clever> i think 2 died in his hands, and ive had the rest physically falling apart
<geist> keyboard was garbage, trackpad was garbage. was vaguely useable with externa keyboard and mouse
<geist> in which case it was just a portable intel machine
<clever> one of them, i used so much, i physically wore a hole in the track pad
<clever> the rest all had hinge problems
<heat> I got a broken key, the CPU throttles constantly in linux unless you get thermald and a really new kernel, the thermal ACPI code wasn't included for some fucking reason (so it can't turboboost under load), S3 wasn't included because who needs suspend
<heat> there are literally references to thermal objects that don't exist
<heat> I'm pissed and this wasn't even my money
<heat> it's like they try to be incompetent
JiTtLe is now known as JTL
scoobydoob has joined #osdev
<clever> heat: if you want some real incompetence, my dads work sent him the new work laptop, after he was fired!
<clever> they claimed the order was canceled, and the laptop still arrived
<geist> they were trying to get rid of it
<heat> hey that's great
<clever> geist: its brand new
<heat> if it was a dell, they were definitely trying to get rid of it
<kazinsal> my current work laptop is a dell and it is definitely not great
<kazinsal> keyboard is *horrendous*
<clever> the previous one was HP
<clever> not sure about the new one
<heat> kazinsal, same here
<heat> the shell also gets really fucking hot
<heat> the constant 400MHz throttle was there to protect me I guess :v
scoobydoo has quit [Ping timeout: 260 seconds]
scoobydoob is now known as scoobydoo
wand has quit [Remote host closed the connection]
<clever> heat: one dell laptop i had, would thermal throttle only if the lid was closed, but cleaning dust out of the heatsink fixed it
<clever> another older dell, never thermal throttled, but one day the cpu fan jammed, and it went into thermal shutdown
<clever> but i just gave the fan a nudge, and it was as good as new
<clever> that thermal shutdown was also weird
<clever> it seemed to go into a major thermal throttle at first
<clever> the system got very laggy, yet cpu/ram usage graphs said it was fine
<clever> and then *click*, it just turned off
wand has joined #osdev
scoobydoob has joined #osdev
<gog`> does it work right with windows
<gog`> like does dell provide a fixed DSDT
scoobydoo has quit [Ping timeout: 276 seconds]
scoobydoob is now known as scoobydoo
<heat> of course not
<bslsk05> ​'Mentorship Session: Writing Linux Kernel Modules in Rust' by The Linux Foundation (01:30:37)
<doug16k> clever, it won't always show up as the clock reducing on intel. I have seen my brother's machines sit at 100C in prime95. stayed 5GHz flat as a ruler
<heat> from what I read, they disabled S3 because windows sometimes BSOD'd when resuming
<heat> it's the definition of 🚢 it
<doug16k> MSI "gameboost" = try to blow up CPU
<doug16k> presumably injecting nops or something to keep it exactly at 100
<heat> of course msi would call that gameboost
<clever> doug16k: yeah, when the rpi thermal throttles, it just ignores the freq the arm asks for, and uses something lower
<heat> it's like a gaming motherboard
<clever> and you have to go thru some special hoops to see the real freq
<clever> doug16k: though the dell that had thermal shutdown, it turned off within something like 5 seconds, i barely had time to investigate what was happening
matt__ has joined #osdev
matt__ is now known as freakazoid333
<doug16k> best auto-OC I have seen yet though. could accidentally put your machine on 5GHz allcore and it would pass prime
<doug16k> not sure whether you would get VRM scent after a while
<doug16k> good luck killing MSI VRM though. they are ridiculous
<clever> doug16k: something i still dont fully understand, is how the pmic and firmware co-operate during clock changes, i would assume its just raising the voltage before the freq, but then you have things like DVS
<doug16k> all you need is to stop clock when the droop is past a threshold
<doug16k> so it might skip some clocks if it needs a lot more current suddenly
<clever> makes sense, but i'm not sure it has hardware that can do it
heat has quit [Ping timeout: 272 seconds]
<clever> the bcm2711C0T revision, also has a different thing to massively help with thermals
<clever> if all of the inputs to a hw block are idle, the clock to that block stops
frkzoid has joined #osdev
freakazoid333 has quit [Ping timeout: 244 seconds]
<doug16k> typical VRM is 100kHz, so it gets to use a new pulsewidth every (1/(100kHz*phasecount)) sec, so if 6 phase, then every 1.6us
<doug16k> 1.6us is an eternity
nick64 has quit [Quit: Connection closed for inactivity]
<doug16k> you are supposed to have enough capacitance to cover the transients
zaquest has quit [Remote host closed the connection]
<doug16k> there's a fixed dI/dt (rising slope of current) determined by the supply voltage and inductance, so you only get to increase current a fixed amount per cycle
xhe has quit [Ping timeout: 255 seconds]
zaquest has joined #osdev
xhe has joined #osdev
noeontheend has joined #osdev
<doug16k> if you go with huge inductors then you can use low switching frequency, and low losses, and the current is hard to move up and down. if you go with tiny inductors, you have to use high switching frequency and take higher losses, and the current can be moved up and down quickly
gog` has quit [Ping timeout: 276 seconds]
tsraoien has quit [Ping timeout: 255 seconds]
<doug16k> so you figure out a ramp up time you can tolerate, and allowing more time allows cheaper vrm and less losses
_xor has quit [Read error: Connection reset by peer]
<doug16k> super efficient one is expensive because the larger inductor's price is much more
<doug16k> need super low ESR caps too for super efficient one
Gooberpatrol66 has quit [Quit: Leaving]
<doug16k> if you cheap out hard on the inductor you can get amazing caps that will actually hold those tiny pulses, if you get giant inductor, garbage caps are fine
<clever> makes sense
gog has joined #osdev
<mrvn> gold caps, all the way *duck*
<doug16k> if you take an existing MB and turn up the switching frequency, it increases losses directly, but makes it have faster reaction time against droop
qubasa has quit [Ping timeout: 276 seconds]
<doug16k> 100KHz would be a default, then you could select maybe 150 then 200
<mrvn> I select 131072Hz
<doug16k> it also reduces the resolution of the PWM
Gooberpatrol66 has joined #osdev
noeontheend has quit [Ping timeout: 244 seconds]
<doug16k> mrvn, yours has a nice round number like that?
<doug16k> it could be any number though, sure
<mrvn> sadly no. stupid hardware store sells me crystals with 1MHz or 16MHz.
<mrvn> stupid decimal people.
<doug16k> the 32.768kHz crystal people are alright
<mrvn> I should order me some of those. My toy CPU runs with a 16MHz crystal (needed for the UART) driving a counter ladder to get a nice slow clock.
<doug16k> the stability of them is pretty impressive. something like -200ppm to 0 from -50C to +100C
<doug16k> 25C is middle, where it is typically +/- 0
<doug16k> so when boiling water off it or freezing it solid, it's out by 0.01%
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<doug16k> that's epic compared to how all over the place normal components are in that temp range
<doug16k> 22.1 cents
<doug16k> CAD
[itchyjunk] has quit [Remote host closed the connection]
<doug16k> $14.60 for 100, wow
nj0rd has quit [Quit: WeeChat 3.6]
mzxtuelkl has joined #osdev
nj0rd has joined #osdev
kof123 has joined #osdev
gildasio has quit [Ping timeout: 268 seconds]
gildasio has joined #osdev
the_lanetly_052 has joined #osdev
gildasio has quit [Ping timeout: 268 seconds]
gildasio has joined #osdev
_xor has joined #osdev
xhe has quit [Ping timeout: 272 seconds]
gildasio has quit [Remote host closed the connection]
<mrvn> doug16k: that's horrible for a clock. 200ppm is close to 2 hours a year.
<clever> just recently, some time nuts at meta got ptp working on the rpi cm4
<mrvn> do you know how much the rpi timers drift?
<clever> basically, it has 2 extra features, 1: it can generate a pps signal that can sync to with ~10ns
<clever> 2: the gigabit PHY can timestamp when a packet arrived
<clever> so you can then know the latency on the network, that your time protocol was under the impact of
<clever> without involving any latency in linux or the arm cores
pounce has quit [Remote host closed the connection]
pounce has joined #osdev
<clever> mrvn: ive not looked up any drift stats for the rpi, but i have been graphing ntp's idea of drift
<clever> and i have obsered, that when my furnace died for 2 days in the winter, the rate of drift changed
<bslsk05> ​'It's About Time (PTP on the Raspberry Pi)' by Jeff Geerling (00:13:55)
<clever> my rough understanding, is that ntp is doing 2 main things
<clever> 1: its just setting the clock
<clever> 2: its measuring the rate of drift, and telling linux to count more/less time per cycle of the hw clock
<mrvn> It's not supposed to do 1 but if the time is off by more than 10-20 minutes it would take forever to get back in sync.
<clever> yeah, 1 is usually only done if its grossly wrong
<clever> usually, it induces a drift, to make it slowly arrive at the right time
<mrvn> or at boot because people don't care about uptime
xhe has joined #osdev
<clever> yeah
<clever> and a related subject, an irc server i used to run, was naughty, and used the date/time clock for ping management
<clever> not the monotonic clock
<mrvn> used to be that you had to run ntpdate to set the time and then ntpd to keep it
<clever> so if the clock goes backwards for even a second, oh, your pong is 2^31 seconds late, goodbye!
<mrvn> hehe
<mrvn> don't use unsigned :)
<clever> mass disconnect, of every user :P
<clever> then its just INT_MAX late
<clever> because the count still underflows
<mrvn> no, -1
<clever> if i send a ping at T=600, and then its now T=599
<mrvn> 599 - 600 = -1 < pong timeout
<clever> what is 599 - 600, in unsigned math?
<clever> yep
<mrvn> 07:57 < mrvn> don't use unsigned :)
<clever> let me grab some screenshots...
the_lanetly_052 has quit [Ping timeout: 240 seconds]
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
<clever> ntp reports this metric as a number near 1, i think 1 means the crystal is running at 100% of the rated speed
<clever> but graphing something near 1, often gives a loss of resolution, so the graph is configured to do data-1
<clever> so a graph of -0.1 means the clock is running at 90% its rated speed, and 0.1 means 110% the rated speed
toluene has quit [Quit: Ping timeout (120 seconds)]
<clever> its interesting that the router and nas, have the reverse shape
gildasio has joined #osdev
<clever> system76 is my laptop, amd is my desktop, both are in the same room, 99.9% of the time
<clever> so you can expect them to be experiencing the same room temp
toluene has joined #osdev
<clever> added one more image to the album, https://i.imgur.com/6Mruj1R.png
<clever> router is in the server room, nas is in the living room, system76/amd are in the bedroom
<clever> at this scale, not much is lining up
<mrvn> it might have components that react in the opposite direction to temp
<clever> yeah
<clever> i think ive heard something else, where increasing amounts of force on the crystal, cause it move kind of like a sine wave around a freq?
<clever> so depending on where it is on that force curve, an increase in temp could make it go up or down in freq
<mrvn> temp changes could create force due to difference in expansion of materials.
<doug16k> yeah crystals convert electricity to shape change, and shape changes generate electricity
<clever> mrvn: exactly
<clever> but how the freq reacts to the change in force, could vary, depending on how much force is being applied, from what i think i heard somewhere
the_lanetly_052 has joined #osdev
<doug16k> put vibration on a crystal and it becomes a crappy power source
<clever> and thats what a lot of old bbq lighters used
<mrvn> hit it and you get a spark across a gap?
<clever> exactly
<clever> internally, it has a spring and some kind of catch, so it builds up force in the spring, comes loose, and slams the crystal
<doug16k> stuff like missiles that pull 50 gees can't even use crystals
<doug16k> or they need very special consideration at least
<doug16k> they use MEMS oscillators
<clever> that reminds me, have you heard about how hydrogen screws up iphones?
<clever> hydrogen can leak thru damn near anything
<clever> including a sealed MEMS oscillator!
<clever> and once inside, it messes up the vibrations, causing the cpu clock to just halt
<doug16k> yeah I do remember now that you mentioned MEMS
<mrvn> And you know from breathing helium that that screws up your pitch.
<mrvn> How much hydrogen do you have around your iPhone that that is a danger?
<doug16k> I can imagine mechanics laying their phone on car batteries a lot
<klange> *achem* it affects your _timbre_, not your pitch.
<clever> doug16k: the case i heard, was an MRI dumping its coolant
<clever> which caused elevated hydrogen levels in the building
<clever> enough to brick every iphone
<clever> they will slowly unbrick, as the hydrogen seeps back out
<doug16k> it can make metal brittle. it's "hydrogen embrittlement"
<doug16k> it's really bad when metal is cold
<mrvn> like when you want liquid hydrogen :)
<doug16k> exactly
<zid`> mems woo
the_lanetly_052 has quit [Ping timeout: 240 seconds]
<mrvn> "You will never need 90% of the math you learn in school in real life. You will need some of it, like those other 20%"
<clever> lol
<clever> there are 10 kinds of people in the world, those who understand binary, and those who dont
<mrvn> s00# people?
xhe has quit [Ping timeout: 240 seconds]
xhe has joined #osdev
<Griwes> there's also those who don't know this joke was in ternary
<mrvn> {{}, {{}}}
<moon-child> {{}, {{}}, {{}, {{}}}}
<mrvn> now define an arithmetic type using sets
<moon-child> Z = {}
<moon-child> S(x) = x ∪ {x}
<mrvn> in c++
radens has quit [Quit: Connection closed for inactivity]
<moon-child> in c++?
<moon-child> I don't think c++ type system can do that :P
<moon-child> it's the same issue as with finger trees iirc
<mrvn> moon-child: template
<moon-child> so compile time only?
<mrvn> you could type erase them
<moon-child> void*
<moon-child> I think that's how they do finger trees in c also :P
the_lanetly_052 has joined #osdev
wand has quit [Remote host closed the connection]
wand has joined #osdev
<bslsk05> ​'Catching an Explosion in Water at 5 Million FPS - The Slow Mo Guys' by The Slow Mo Guys (00:20:36)
heat has joined #osdev
mzxtuelkl has quit [Quit: Leaving]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
chartreuse has quit [Remote host closed the connection]
GeDaMo has joined #osdev
bauen1 has quit [Ping timeout: 244 seconds]
<dzwdz> i'm trying to port my kernel to x64 - i got to the point where it compiles fine, but GRUB complains about "invalid arch-dependent ELF magic"
<dzwdz> i checked grub's source, it expects the elf's machine type to be x86-64, but the linker sets it to none
<bslsk05> ​github.com: grub/dl.c at master · coreos/grub · GitHub
<dzwdz> how can i get the linker to set the correct machine type?
<zid`> did you.. build a weird crosscompiler?
<zid`> or rather, cross binutils
<dzwdz> depends on your definition of weird
<dzwdz> i haven't patched it
<zid`> what tuple or whatever did you build it with?
<dzwdz> x86_64-elf
<zid`> hrmph, strange
<dzwdz> oh actually i've just realized i'm not on the newest version
<dzwdz> i've reused the sources i used to compile the i686 toolchain a while ago
<dzwdz> which worked fine
xhe has quit [Ping timeout: 260 seconds]
<zid`> did you make clean?
xhe has joined #osdev
<dzwdz> i removed the entire build directory, and reran configure
<zid`> make clean is easier and more robust, but it probably worked fine
<dzwdz> oh, i forgot to mention
<dzwdz> i'm using the elf64-little output format
<zid`> might be a bug in that backend then maybe?
<dzwdz> because whatever the default output format was, it included 2 megabytes of zeros right at the beginning
<zid`> -z max-page-size=4096
<zid`> you're welcome
<zid`> the x86_64 default elf I think expects you to want to map things with 2M pages
<dzwdz> i think when i tried that gcc complained about not being able to find "max-page-size=0x1000"
<zid`> not gcc
<zid`> ld
<zid`> so you'd need -Wl,-zmax-page-size=4096
<dzwdz> oh
<zid`> to pass it through to ld from gcc
<zid`> ld is the thing that makes the final elf afterall
<dzwdz> yeah, ik
<dzwdz> for some reason i just assumed that gcc would figure out that this needs to be passed to the linker
<dzwdz> ok, adding that and going back to the default output format fixed the issue
<dzwdz> thanks a lot!
<zid`> That'll be $893
dzwdz has left #osdev [WeeChat 3.5]
<zid`> he ran away hah
dzwdz has joined #osdev
<zid`> back with a false moustache?
<dzwdz> who
<zid`> you parted and rejoined when I joked about owing me $893
<dzwdz> who, me?
<zid`> ofc
<dzwdz> no that must've been someone else
<dzwdz> i just joined
<zid`> ah sorry, I mistook you for someone else
<zid`> he looks just like you, but without a moustache
<zid`> I do wonder why you weren't apparently doing a seperate link step though
<dzwdz> i am
<dzwdz> i'm just calling gcc instead of ld
<zid`> ah so you can just move it to the ldflags, no need to -Wl it
<zid`> oh
<dzwdz> ...i'm not sure why i'm doing that tbh
<zid`> even weirder, grats
<dzwdz> it's been a long time since i wrote the makefile
<zid`> someone dropped a huge makefile on me and I don't use 90% of it
<zid`> I should just delete all the bits I don't use
<zid`> keep the binary build + image creation rules and get rid of the rest
<zid`> https://github.com/zid/bootstrap/blob/master/Makefile Oh right, I did that already for the 'split out skeleton repo version' already, I forgor
<bslsk05> ​github.com: bootstrap/Makefile at master · zid/bootstrap · GitHub
<dzwdz> wow, that's small
<zid`> I mean, what else does it really need to do?
<dzwdz> mine also builds the init binary, the initrd, and runs tests
<zid`> tis a skeleblob too don't forget
<zid`> Mine just builds boot.bin, kernel.bin, and uses those two files + stage2_eltorito to make a bootable grub cd-rom
<zid`> boot.bin is a 32bit ELF that's a 64bit elf loader
gog` has joined #osdev
<zid`> hegoog
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<gog`> moew
<gog`> i had big plans today
<gog`> chose slep instead
<zid`> That's a reasonable big plan
<gog`> agreed
eroux has joined #osdev
<heat> using gcc instead of ld to link is good practice
<heat> you're the weird one using ld
<zid`> gcc is good if you're using system defaults
<zid`> ld is better if you're building weird things like kernel images
<gog`> who does that anyway
<zid`> good point
pretty_dumm_guy has joined #osdev
frkzoid has quit [Ping timeout: 272 seconds]
gog` has quit [Ping timeout: 260 seconds]
<heat> using gcc is always useful
<heat> for instance, some options you'd pass gcc aren't really linker options, the gcc spec has a bunch of defaults you may want to use, LTO is a PITA to set up without gcc
<zid`> hmm?
<zid`> To me that's like saying "C compilation is hard without gcc"
<zid`> as long as you build with -flto and then link with it too it justworks because that's how gcc does it, plugin lto is a pain though yea
<zid`> -fwhole-program *is* nice though
gog has quit [Ping timeout: 276 seconds]
xhe has quit [Ping timeout: 272 seconds]
<zid`> but I don't think ld cares about that? I think that just goes around making things static internally
smpl has joined #osdev
xhe has joined #osdev
the_lanetly_052_ has joined #osdev
the_lanetly_052 has quit [Ping timeout: 244 seconds]
the_lanetly_052 has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 268 seconds]
tsraoien has joined #osdev
<bslsk05> ​wiki.osdev.org: Setting Up Long Mode - OSDev Wiki
<dzwdz> why does the gdt here have a 32-bit tss?
<dzwdz> because if i understand correctly, i'm going to need a 64-bit tss in long mode
<zid`> because every piece of example code on the wiki is terrible?
<dzwdz> so i guess i have to delve into the manuals?
<zid`> when would you not use them?
<dzwdz> when i'm lazy
<dzwdz> so, most of the time
<dzwdz> isn't that kinda the point of the wiki, too?
<zid`> the wiki is a loose collection of things written by various people of various skill levels
<zid`> it's jus glad of content
<zid`> you don't even need a TSS there, which is why it doesn't matter that it's broken af
<dzwdz> but without one interrupts won't work, right?
<zid`> I use a 'stub' gdt that's just code and data, then C code loads actual ones
<zid`> because why the hell would you write all this in assembly using hardcoded values, for a 'real' OS?
<dzwdz> on i686 i've been setting up the gdt in C too
<zid`> I have a nice C function that takes some enums and combines them into bits and splats them into an array which I lgdt in an asm("") block
<zid`> I just need a temporary one (like grub provides to pmode) in order to run it
<bslsk05> ​github.com: bootstrap/long.asm at master · zid/bootstrap · GitHub
<dzwdz> but now if i have to set up the gdt before i can load C code (unless i bothered to separately compile the GDT stuff... with a separate 32 bit compiler i guess), why bother setting it up again later?
bauen1 has joined #osdev
<zid`> You need one per cpu, for starters?
gildasio has quit [Remote host closed the connection]
<dzwdz> hm
<dzwdz> i didn't set up smp yet so i didn't know that
<zid`> unless you wanna re-use the same exception stack
<zid`> for every cpu
<zid`> sounds like a bad plan to me
gildasio has joined #osdev
<zid`> 64bit only really uses tss to load a ring0 stack from for interrupts
gxt has quit [Remote host closed the connection]
gog` has joined #osdev
gog` is now known as gog
gxt has joined #osdev
<dzwdz> does long mode remain activated after i disable paging?
<dzwdz> the docs say that the cpu behaves as 32-bit until i enable paging, but they don't seem to mention disabling it again
<gog> long mode requires paging
<gog> and it's generally a bad idea to try to exit long mode once it's started
<gog> if you try to disable paging while EFER.LME is active you'll get a #GP
<zid`> There's a nice flowchart in the manual
<zid`> a lot of the arrows are #GP
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
<dzwdz> and i'm not supposed to map the kernel in userland because of meltdown, right? so i'd need to reload cr3 on every syscall?
<zid`> found it, figure 4.1
<zid`> ~page 108 depending on manual version
<dzwdz> which manual, intel or amd?
<zid`> intel
<zid`> clear pae is #gp, clear LME is #gp, clear PG does actually work
<gog> oh it does?
<gog> interesting
<zid`> It puts you into a dotted box so I think nothing actually changes
<zid`> but you can then disable LME and/or PAE
<zid`> to get into a real cpu mode
<gog> well, in any case, no you don't reload cr3 on system calls, you use the user/supervisor bit in the page table to protect kernel pages
<zid`> meltdown he said, gog
<zid`> and for meltdown, yea you do, or use PCI or whatever it's called, I think that's safe
<dzwdz> zid`: which chapter is that in? page 108 is the manual i have open is about floating point exceptions
<zid`> volume 3, the one about osdev
<zid`> figure 4-1
<gog> you _can_ use page table isolation and only map the system call code which in turn will load kernel page tables
<zid`> approximately 108 pages into it
<dzwdz> so in i686 i was doing something kinda similar
<dzwdz> where instead of reloading cr3 i was just disabling paging
<dzwdz> i assumed that'd be faster
<zid`> I'd be surprised if enabling paging again didn't flush the TLB
<zid`> but who knows
<dzwdz> i haven't benchmarked it
<dzwdz> it was easier than setting up proper paging anyways
<gog> oh also the IDT and ISRs
<gog> gotta have those
<gog> and the GDT probably
<dzwdz> yup, i needed to map the GDT too iirc
<zid`> yea almost everything is a linear addresss
<zid`> the only physical address anything cares about is cr3 really
<zid`> (swap the object and subject in that sentence pls)
<dzwdz> so that flowchart tells me that i can disable paging in long mode and it won't crash
<dzwdz> actually nvm
<zid`> Although, there's a note above
<zid`> that says doing it will #GP if you're in long mode at the time
<zid`> so I'm not sure who to believe anymore!
<zid`> says you need to go into compat mode before it works
<gog> so LMA has to be 0
<zid`> no, L bit
<gog> o
<gog> oh yehj
<zid`> unsetting LM is a gp for sure
<zid`> and the way to unset L is to.. jump to a selector without L set, which makes sense
xhe has quit [Read error: Connection reset by peer]
<gog> yes
<zid`> which is basically WHY all this shit #GPs anyway
xhe has joined #osdev
<zid`> suddenly the state makes no fucking sense
<gog> the most general of faults
<gog> why does it happen? many reasons
<zid`> it's just more succinct than "shit's fucked yo"
<dzwdz> i still don't really see why disabling paging the normal way would GP
<gog> my architecture will have a #SF exception
<gog> "shit's fucked"
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
<dzwdz> the 64bit gcc toolchain won't output 32bit code, right? so if i wanted to write the code that'd set up paging for long mode in C, i'd need two toolchains?
X-Scale` has joined #osdev
jafarlihi has joined #osdev
<zid`> -m32
X-Scale has quit [Ping timeout: 272 seconds]
<zid`> it's even in the makefile I linked
X-Scale` is now known as X-Scale
<jafarlihi> Is `pfifo_fast_dequeue` good place to hook if I want to check sent packets against Wireshark to be sure nothing is hidden?
<dzwdz> oooooh
<zid`> and for binutils it varies by tool, hoorah
<gog> binutils is a mess
<dzwdz> so is gcc
<zid`> but for ld it's -m elf_i386
<zid`> binutils is a MESS
<zid`> It's mainly that some options are shared, but some are implemented by the specific emulation
<dzwdz> is -m32 the only way, or can i set some attribute on a function to mark it to be compiled to 32bit code?
<zid`> -m32
<zid`> it's per TU only
hbag has joined #osdev
<gog> hbag:
<gog> sup
<hbag> just rejoining since i realized i havent rejoined since my connection last died
<gog> :D
nyah has joined #osdev
jafarlihi has quit [Quit: WeeChat 3.5]
<doug16k> dzwdz, x86_64 will generate i386 code, and the codegen is more how x86_64 cpus like it, too
<doug16k> it likes using whole registers more, for example
[itchyjunk] has joined #osdev
gog has quit [Ping timeout: 240 seconds]
<doug16k> a real 32 bit cpu will have no trouble with it though. more like the generated doesn't make x86_64 merge partial registers so much
blockhead has quit []
nvmd has joined #osdev
ripmalware has quit [Quit: Leaving]
matt__ has joined #osdev
matt__ is now known as freakazoid333
nvmd has quit [Quit: WeeChat 3.6]
nvmd has joined #osdev
TorusField has joined #osdev
k0valski1889 has joined #osdev
<klys> anyone around toying with gcc 12 ?
<zid`> toying how?
<zid`> using it as a compiler? for ages
gildasio has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
<klys> looks like 12.1 was released on 06may2022.
gildasio has joined #osdev
freakazoid333 has quit [Ping timeout: 240 seconds]
gog has joined #osdev
Bonstra has quit [Ping timeout: 240 seconds]
gog has quit [Ping timeout: 240 seconds]
nyah has quit [Quit: leaving]
nyah has joined #osdev
Bonstra has joined #osdev
meisaka has quit [Ping timeout: 255 seconds]
meisaka has joined #osdev
ebrasca has joined #osdev
<ebrasca> What is the BAR for 82540EM ?
<zid`> question makes no sense
<zid`> devices have BARs
zaquest has quit [Ping timeout: 240 seconds]
xenos1984 has quit [Read error: Connection reset by peer]
<zid`> if a 82540 is a pci device, it has BARs
frkazoid333 has joined #osdev
<bslsk05> ​www.technologyreview.com: The US military wants to understand the most important software on Earth | MIT Technology Review
<ebrasca> zid`: I need the one with the pci IO region
heat has quit [Ping timeout: 268 seconds]
gog has joined #osdev
blockhead has joined #osdev
<zid`> If it's a pci device, it *must* have one.
<zid`> that's what makes it a pci device
xenos1984 has joined #osdev
<ebrasca> It has more than one BAR , some of the BARs are denoted as low register or hight register.
tsraoien has quit [Quit: WeeChat 3.5]
tsraoien has joined #osdev
<zid`> So you wish to know which BAR is which?
<zid`> which bar means what is up to the device, anyway
tsraoien has quit [Client Quit]
<zid`> the capabilities list in the config space knows some stuff about them though
tsraoien has joined #osdev
<geist> yeah there's not enough context to understand what you're asking here
<geist> for IO regions there's a bit set in the BAR descriptor. i think bit 0?
tsraoien has quit [Client Quit]
tsraoien has joined #osdev
<zid`> yea, mem/io, 32/64, prefetchable
<geist> the bottom couple of bits are flags and the io regions must be 16 byte aligned i believe (and mmio must be 4k)
<zid`> I had the i350 manual open at the exact page when you said that :P
<zid`> i350*
jafarlihi has joined #osdev
<jafarlihi> How can I get all exported and unexported symbols from Linux kernel?
<jafarlihi> Or just exported
<jafarlihi> I've got linux-lts-headers install on Arch, can I pull it from there?
<geist> hi linux question asker
<geist> answer is maybe but who the hell knows
<geist> depends on distro, how yo got the kernel, etc
<geist> or you could maybe try to pull it out of the kernel binary itself
<geist> but beats me, we're not a linux kernel answer channel
* mjg_ hands geist a chill pill
<mjg_> not that i don't concur :-P
<jafarlihi> I bet you'll use my malware detector once I finish it
<bslsk05> ​en.wikipedia.org: System.map - Wikipedia
frkazoid333 has quit [Ping timeout: 244 seconds]
<jafarlihi> Thanks but I need to pull them without building the damn thing
gxt has quit [Remote host closed the connection]
jafarlihi has quit [Quit: WeeChat 3.5]
gxt has joined #osdev
matt__ has joined #osdev
<geist> GeDaMo: ERR_INSUFFICIENT_ANSWER
<geist> Though i guess they did at least say thanks
<gog> lol
<gog> I'm gonna write my malware detector now
<gog> and then malware to detect
<gog> imagine though that the malware detector kernel components are themselves insecure and big glaring attack surfaces
<gog> seems fishy
* jjuran throws gog a fishy
<mjg_> i'm gonnna write a malware-proof kernel
<GeDaMo> No code, no bugs :P
<mjg_> that's right
<jjuran> what about a malware-proof malware
<mjg_> it's gonna boot and print "lol gtfo"
<mjg_> well, boot
<mjg_> you know what i mean
<mjg_> :)
<mjg_> jjuran: actually writing malware which detects other malware and fucks it up would be interesting
* gog eats fishy
<mjg_> friday?
<gog> can't have a smaller attack surface than none
<mjg_> i clicked on 'parental guide' for top gun maverick
<mjg_> Profanity
<mjg_> > A middle finger gesture is used.
<mjg_> pass
<mjg_> maybe they should not include stuff a middle schooler encounters on daily basis
xhe has quit [Ping timeout: 240 seconds]
<klys> it was a just few months ago that I spent 1900 on one of those: https://www.ebay.com/itm/363817088527 still haven't received it either.
<bslsk05> ​www.ebay.com: AMD EPYC Milan 7453 28-Core 2.75GHz SP3 225W Server Processor CPU 100-000000319 | eBay
<mjg_> heh, you reminded me to check on laptop prices
<mjg_> i had my eyes on a zen laptop, but given retbleed maybe i'll try something less fucked by it
<sbalmos> an Etch-A-Sketch?
xhe has joined #osdev
noeontheend has joined #osdev
<geist> klys: ah yeah it was you that was dumping an insane amount of money into some home server thing?
<geist> Like 100gbit network, etc?
<geist> mjg_: meh. I wouldn’t worry about whatever the latest nonsense is. Also zen 3 doesn’t seem to be effected by it
<geist> But if it’s not retbleed it’ll just be the other one. You can’t win except to run really legacy stuff
<geist> At the end of the day you gain/lose some percentage of points on some benchmark. But it’s still a laptop. It doesn’t suddenly become trash if it gets n% slower in some syscall
<geist> This is one of those cases where you’re just better off if you dont know how the sausage is made. Lots of times kernel folks like us i think put too much value in these little details, whereas in the grand scheme of things if it shows cat pictures it does its job
<mjg_> i thought the migitation disables some of speculative execution altogether
<mjg_> not just kernel-side
<mjg_> general point being my good ol' haswell laptop kind of works, but it is slow
<mjg_> would be quite a bummer to buy a new one only to find it shitting the bed on single-threaded stuff
<mjg_> with perspective of it getting even slower down the road
xhe has quit [Ping timeout: 272 seconds]
wand has quit [Ping timeout: 268 seconds]
wand has joined #osdev
<bslsk05> ​www.intel.com: Indirect Branch Restricted Speculation
<gog> mew
<klys> geist, I'm slow at making money too, I still haven't bought the ram yet. just the motherboard and cpu.
<geist> That seems like a really bad idea
<geist> Always buy computer hardware when you need it
<geist> Since the price will usually go down over time
<klys> the better zen 3 7003 options are still above 2k which cuts me out
<klys> that ebay listing is probably just a fluke
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
vinleod has joined #osdev
<mrvn> It would be nice if application doing sensitive stuff could enable those mitigations as needed.
vinleod is now known as vdamewood
<mrvn> "I'm going to do some online payment, disable all speculatiuve execution now"
<moon-child> have an isolated core
<moon-child> numactl -Ck firefox, where k is the in-order core that doesn't get to run anything you don't specifically ask to run on it
<moon-child> (sans the 'in-order' part, you can do this today)
<mrvn> you also need the cores that share caches
<moon-child> (which is significant given that runtime toggling of mitigations may be impractical for kernels)
chartreuse has joined #osdev
<moon-child> mrvn: sure, yes
<mrvn> And when you aren't online shopping you can let other stuff run on the cores too.
<moon-child> well, hmm. The point is to observe branch timing. But l2/l3 hit should be slower than a branch mispredict. Do these vulnerabilities only apply to stuff in l1? Haven't looked too closely
<moon-child> easy solution is just get an old laptop or crappy pc and use that :P
<mrvn> I should look into making a cgroup for firefox and hack something together to limit the cgroup to 0.1% cpu time whenever the window is minimized.
<moon-child> (easy--and much more robust)
noeontheend has quit [Ping timeout: 255 seconds]
heat has joined #osdev
Matt|home has quit [Quit: Leaving]
noeontheend has joined #osdev
wootehfoot has joined #osdev
Matt|home has joined #osdev
dude12312414 has joined #osdev
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
noeontheend has quit [Ping timeout: 240 seconds]
<mrvn> Do any of the performance counters update when doing speculative execution that then isn't taken?
nyah has quit [Ping timeout: 268 seconds]
wootehfoot has quit [Ping timeout: 240 seconds]
wootehfoot has joined #osdev
<immibis> mrvn: Interesting question, my gut says yes. Because that DOES affect performance!
<immibis> hmm
<immibis> the obvious follow-up is: can any of them be used to leak memory contents?
<zid`> moon-child: can there *be* anything interesting in l1?
<mrvn> immibis: I don't mean the branch itself. That obviously increments the branch miss counter. I mean the rest of the instructions that need to be undone.
<zid`> it's non-shared and there isn't really space for anything interesting to be there that isn't the exploit code itself :P
<zid`> or the remnants of the context switch
<immibis> I think the performance counters would be kinda useless if they didn't. Depends on the specific counter, obviously.
<mrvn> zid`: the bit of memory the exploit code tries to read
<immibis> The one for instructions issued SHOULD be incremented when the processor speculatively issues an instruction.
<immibis> The one for instructions retired SHOULDN'T be incremented because incorrectly speculated instructions do not retire.
<immibis> and so on.
<mrvn> immibis: then that instantly leaks information
<immibis> geist: We live in an environment where there is a non-negligible chance of money being worthless next week
<immibis> although if that happens, probably computer parts will also be relatively worthless so you may still be able to buy some
<mrvn> immibis: because that has happened so many times recently?
<zid`> My plan is to trade sex for them
<mrvn> I would rather say the problem is you don't have money, you have bits.
<zid`> wait nvm that's also my current plan
<mrvn> zid`: Give me all your food or I will fuck you?
<zid`> moon-child: hi
<mats1> yes daddy
<zid`> you can't call me daddy without subscribing to my onlyfan
<mats1> yes mother
thatcher has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<zid`> I say onlyfan because it only has the one sub, YOUR mother
<moon-child> you're subscribed to yourself?
thatcher has joined #osdev
<zid`> No I'm his dad
Lumia has joined #osdev
mimmy has joined #osdev
Lumia has quit [Quit: ,-]
Lumia has joined #osdev
Lumia has quit [Quit: ,-]
matt__ is now known as freakazoid333
MarchHare has joined #osdev
<mrvn> Learned something new about C++ again: https://godbolt.org/z/qrobf9cGq
<bslsk05> ​godbolt.org: Compiler Explorer
<mrvn> Didn't know you could inline initialize member variables with values of previous members that aren't even inline initialized.
<immibis> makes sense but also wtf
<immibis> remind me to use that at work
<mrvn> If you think about how initialization works with constructors it makes sense. It's just `graph(std::size_t v) : V(v), row(std::vector(V)), matrix(V, row) { }
the_lanetly_052_ has joined #osdev
<mrvn> If you don't initialize V you get a warning but no error.
the_lanetly_052 has quit [Ping timeout: 268 seconds]
mimmy has quit [Ping timeout: 244 seconds]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
mimmy has joined #osdev
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
heat has quit [Remote host closed the connection]