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
m3a has quit [Ping timeout: 276 seconds]
m3a has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
innegatives has quit [Quit: Connection closed for inactivity]
Matt|home has quit [Quit: Matt|home]
edr has quit [Quit: Leaving]
Left_Turn has joined #osdev
jcea has quit [Ping timeout: 268 seconds]
Left_Turn has quit [Read error: Connection reset by peer]
Matt|home has joined #osdev
chiselfuse has quit [Ping timeout: 244 seconds]
Jari-- has joined #osdev
chiselfuse has joined #osdev
gog has quit [Quit: byee]
sprock has joined #osdev
<aaabbb> looks like that openbsd TIOCUNCTL bug is actually a pledge bug
<aaabbb> so not something that's been stuck in their vt subsystem for ages, but a problem with the (relatively new) security system
eluks has quit [Remote host closed the connection]
eluks has joined #osdev
GeDaMo has joined #osdev
Lucretia has joined #osdev
<chiselfuse> i have another question which i can't find the answer to
<chiselfuse> i disabled ASLR system-wide and surely enough every time i exec() some /usr/lib/lib*.so file repeatedly, its segments get loaded in the same 0x7fffxxxxxxxx address. (yes, i know they're not supposed to be executed and they segfault but i let gdb pause them at their entry address)
<chiselfuse> however, some /usr/lib/libfoo.so's base address will always get set to a different address than that of some /usr/lib/libbar.so's.
<chiselfuse> when i check their headers, the Offset and VirtAddr of the first LOAD segment are always 0. i can't find any other relevant difference in the output of `readelf -aW` that can tell me why the loader decides to pick a different base address for every /usr/lib/lib*.so
<chiselfuse> to try for yourself you can do `gdb /usr/lib/libfoo.so`, then `starti`, then `i proc m` on different files under `/usr/lib/`.
<chiselfuse> after disabling ASLR system-wide with `sudo sysctl -w kernel.randomize_va_space=0`
jedesa has quit [Remote host closed the connection]
Jari-- has quit [Ping timeout: 276 seconds]
netbsduser` has joined #osdev
\Test_User has quit [Ping timeout: 276 seconds]
\Test_User has joined #osdev
goliath has joined #osdev
netbsduser` has quit [Ping timeout: 244 seconds]
<zid> what's a tiocunctl when it's at home?
<Ermine> NTOSKERNAL.EXE
xvmt has quit [Remote host closed the connection]
<chiselfuse> hey all-knowing zid please help me with my question :p
<zid> it's linux shit
<zid> ask linux people
<chiselfuse> but do you not *happen* to know..
<zid> I don't even fully understand the question
<zid> your complaint is that the load addresses of different .so files is consistent, but different?
xvmt has joined #osdev
<chiselfuse> zid: when ASLR is disabled, doing exec on the same .so file repeatedly has it loaded on the same address. however, the load address is different for every .so file
<chiselfuse> if that makes sense
<zid> so.. that's a yes?
<chiselfuse> yea
<zid> My guess would be size
<zid> it's aiming to leave a certain sized gap somewhere
<zid> for stack or mmap or whatever to use
<kof673> https://en.wikipedia.org/wiki/Prelink is prelinking involved?
<chiselfuse> kof673: is this for me?
<kof673> yes
<kof673> i don't think it is, just throwing that out there
<kof673> why would it want the same address for a file?
<Ermine> somewhy sysv abi website misses first 3 chapters
<chiselfuse> kof673: reading...
<chiselfuse> Ermine: yea i think they never got written
<Ermine> surely they were written
<chiselfuse> Ermine: https://www.uclibc.org/docs/psABI-x86_64.pdf is this what you want?
<chiselfuse> Ermine: i guess the newest one is here https://gitlab.com/x86-psABIs/x86-64-ABI
<bslsk05> ​gitlab.com: x86 psABIs / x86-64 psABI · GitLab
<chiselfuse> i'm misremembering something about it having missing spec but i'm almost sure it does
<Ermine> it's arch supplement
<Ermine> i mean the primary one
<chiselfuse> i dont understand
<chiselfuse> kof673: well i'm not using this `prelink` utility so unless it's implemented by default somehow now then it's not involved
<chiselfuse> Ermine: can you link me the website that's missing it?
<bslsk05> ​www.sco.com: System V Application Binary Interface - DRAFT
<chiselfuse> i never understood what that website was and why it's *the* sysv abi website
<kof673> sco is old i guess
<chiselfuse> and why it hosts some 2013 draft
<chiselfuse> is the 2013 the latest one accepted or something?
<chiselfuse> zid: after testing many .so files with your hypothesis in mind, i think your magnificent golden skull is definitely right again
<chiselfuse> i was so bothered that there might've been something in the elf file directly restricting where it gets loaded even though it's PIC
parabirb has quit [Quit: WeeChat 4.5.2]
parabirb has joined #osdev
\Test_User has quit [Ping timeout: 276 seconds]
\Test_User has joined #osdev
gog has joined #osdev
gog has quit [Ping timeout: 245 seconds]
EmanueleDavalli has joined #osdev
<heat> chiselfuse: how would it pick... the same address for every library?
<zid> He was just running them
<Ermine> MICROSHILL WINCRAP
<Ermine> shared printers are PITA
vdamewood has joined #osdev
<chiselfuse> heat: i was exec()ing them. i mentioned how with gdb above if you want to try it
<chiselfuse> just out of curiosity of what the loader does to DYN elfs that don't have an interpreter
<heat> it loads them
<chiselfuse> well yea, like i said. i was just puzzled why it picked a consistent yet different base address for each one
<heat> because virtual address allocation works (generally) top down
<chiselfuse> heat: by "top" you mean high addresses, right?
<heat> you're seeing them allocated in 0x7fff<...> because that's the top-est address you can grab
<heat> yes
<heat> then it all depends on the size of the shared object
<kof673> couldn't all this just be settled by looking at the source :D
<chiselfuse> that's consistent with what zid said yea
<kof673> it might even have comments ;D
<heat> the whole ELF loading "stack" might be around 5KLOC
<chiselfuse> kof673: i am too unintelligent to find the answer through reading it :p
<heat> so... good luck?
<kof673> i don't blame you, just that is what "tech support" did ...ignore everything for serious problems, go see what the source actually does
<kof673> ignore the documentation, see what the source actually does lol
<chiselfuse> i think my question was about a platform-specific behavior that's not spec or documented
<kof673> ignore the code's lips, watch its hands /s
<heat> this is most definitely not spec
innegatives has joined #osdev
<zid> which you were also told, twice ;P
<zid> I should just start doubling up on my responses. I should just start doubling up on my responses.
karenw has joined #osdev
<pog> hi zid hi zid
<pog> zid i made an aquilo ship but it's not quite right
<pog> i have asteroid balancing issues
<pog> and i'm not handling overflow properly i think
<zid> toss em overboard if count > 200
<pog> i made it to aquilo tho and i went to the surface and idk what i'm supposed to do
<zid> you need
<zid> to bring concrete
<zid> you can place concrete to make floor
<heat> hi zid hi zid hi zid
<heat> linux krenel
<zid> kenrel
karenw has quit [Ping timeout: 252 seconds]
<pog> zid: i have all the concrete i could never need from fulgora
<pog> it's so much concrete
<pog> the extinct fulgorians sure did seem to have a high-tech society. wonder what happened to their planet
<GeDaMo> Somebody stole all their concrete :|
<zid> time to pave everything then
<zid> drop 100 solar panels to 1% power a chem plant or whatever, melt 1 lot of ice
<zid> to start up a nuclear reactor
<zid> use it to melt more ice
<zid> use offshore pump to get ammonia slush, to make platform and more water for more nuclear
<pog> burner and rocket fuel
<pog> heating tower*
<pog> you can set it up to provide the initial heat and backup
<heat> no.
<nikolar> heat
<pog> heat we need to provide you
<heat> nikolar
<nikolar> heat
<pog> we need to transfer you from place to place
<kof673> provider, consumer action, reaction this is oo or design pattern like
<pog> factorio is about design patterns and consumers/producers and routing
<nikolar> pog: that's not enterprise enough
<nikolar> step it up
<pog> nikolar: parameterized blueprints are like generics
<nikolar> going in the right direction
<pog> idk what IoC would be
<zid> nuclear gives you power
<pog> nuclear gives you heat
<pog> which you then convert to steam
<zid> burner only gives you heat doesn't it?
<zid> I suppose you could attach exchangers, I forget the temp of a burner
<pog> the heating tower goes up to 1000c
<zid> nuclear fuel is just way more shippable
<zid> gives you like 100TJ per slot or whatever, rather than 100MW
<pog> you can produce solid fuel for free on aquilo
<zid> MJ
<zid> only after you're set up
<zid> you need a bunch of power first
<zid> and heat
<nikolar> heat gives you power
heat is now known as _Heat
<pog> you can ship in rocket fuel from fulguora which is nearly free
<zid> so it's generally easiest to just bring 1 reactor and 1 stack of cells
<nikolar> _Heat gives you power
<zid> rather than a burner and 100 stacks of rocket fuel
<_Heat> nikolar: fucking knew it
<nikolar> you're welcome
<GeDaMo> Where are you going to put the marketing department? :P
<pog> inside the box with the captured biter nest surrounded by laser turrets
EmanueleDavalli has quit [Quit: Client closed]
Left_Turn has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 248 seconds]
zapata92 has joined #osdev
<pog> zapata92: meowdy
<zapata92> hay
<pog> is me
Left_Turn has joined #osdev
<zapata92> hey you
<zapata92> I haven't been on irc since like 2005
Turn_Left has quit [Ping timeout: 248 seconds]
<pog> welcome back, this is the hottest osdev channel in the world
Turn_Left has joined #osdev
<nikolar> welcome back
Left_Turn has quit [Ping timeout: 276 seconds]
<pog> fwiw i haven't done a lot of osdev lately, but i have a weird little UEFI thing i've been doing
<pog> a very weird thing in fact
<FireFly> OS-adjacent deveolpment in #osdev?
<zapata92> I have a xilix FPGA kit with an ARM core and today I am going to learn its boot process and load something bootable into nonvolatile memory
<zapata92> what is weird about your UEFI thing
<kof673> its just one giant osdev-a-bslsk with the power to turn to kernel stone :D
goliath has quit [Quit: SIGSEGV]
<_Heat> pog: what weird thing
<pog> _Heat: the syscall interpositor thing
<_Heat> i forgor
<pog> the posix compat layer
<pog> idk if i showed it
<_Heat> i'm implementing NVME over TCP for edk2
<zid> I remember you asking lots of "err.. try it?" questions
<pog> it actually works tho
<zid> like whether it'd need you to restore its exact gdt or if a copy was fine, stuff like that
<pog> yeh i FAFO's
<zid> flailed around and fucked off
<pog> yes
netbsduser` has joined #osdev
<pog> zapata92: idk if it's my latest changeset but this is the weird thing
<bslsk05> ​github.com: sophia/boot at kjarna · adachristine/sophia · GitHub
zapata92 has quit [Ping timeout: 272 seconds]
<pog> oops i scared them away
<zid> uefi does that
<pog> :')
<nikolar> all my homies hate uefi
<zid> anyone wanna buy my 6800 ultra
<nikolar> no
<zid> dang
<pog> no
<nikolar> zid: i know
<nikolar> we should use openboot
<nikolar> or whatever it was called
<zid> what's that, to do what
<nikolar> it was sun's (i think) bios
<nikolar> i think ibm used it for ppc stuff too
<nikolar> i forgor
<_Heat> open firmware
<nikolar> yeah that's what they called it
<nortti> aren't there some x86 systems that used open firmware too?
<nikolar> not a clue
<zid> what for though
<nortti> https://www.openfirmware.info/Open_Firmware on the OLPC XO-1, looks like
<nikolar> what do you mean what for
<bslsk05> ​www.openfirmware.info: Open Firmware - OpenBIOS
<zid> you said we should use
<zid> I asked for what
<nikolar> instead of uefi
<nikolar> because uefi sucks
<zid> oh, I don't use uefi anyway
<nikolar> as we established
<nikolar> i do, my laptop doesn't have csm :(
<_Heat> "I don't use uefi anyway" -- person using EFI
<zid> actually atm I think I do
<zid> cus w10
<zid> but I've never booted linux with uefi at least
<_Heat> and the firmware is all EFI internally, too
<nikolar> i think i had a bios w10 install
<nikolar> like 10 years ago
<nikolar> lol
<zid> It's not possible on the current isos
<zid> H22 or whatever changed a load of stuff
<zid> H21?idk what they call it
<nikolar> interesting
<zid> it's also the one that broke amd virt
<zid> :D
<nikolar> i bet an update from an earlier build would've worked
<_Heat> 21H2
<zid> That's it
<zid> heat knows his w10 versioning scheme
<zid> for some reason
<_Heat> i don't but i recognized that update out of your attempts to spell it out
<nikolar> for some reason
<_Heat> i think it's <last 2 digits of the year>H<half of the year>
<_Heat> or something
<zid> for some reason
<_Heat> so 21H2 was 2021 second half of the year (november)
<nikolar> zid: how does it feel to have to do software emulation for everything
<zid> like what
<nikolar> idk
<nikolar> stuff
<zid> nikolar you don't have talk some shit sometimes
<zid> half*
<nikolar> huh
<zid> exactly huh
<_Heat> i found something interesting about qemu user networking
<zid> it's weird and crappy?
<nikolar> hey it works ok
<_Heat> connecting to the gateway is the same as connecting to the host
<nikolar> oh
<nikolar> you can ssh from the vm to the host or something?
<_Heat> yeah
<nikolar> cute
<nikolar> that's actually handy for copying files and such
<zid> what.. do you normally do with a gateway?
<zid> like, my machine is 172.22.160.1 wrt to my VMs
<zid> ofc if they ssh to the gateway, they get the host?
<nikolar> i've never tried it, no clue
<zid> it's just the lan ip
<zid> of the router
<nikolar> lol i have a hidpi screen on my laptop now
<zid> 192.168.100.1 is my router, 192.168.100.128 is a desktop machine, they can just.. talk to each other.. that's the point of the subnet?
<nikolar> and the vm's screen is tiny
<nikolar> i enabled scaling in my vm and it broke :(
<clever> zid: until the wifi router comes along and says no war driving, lol
<clever> my laptop and desktop couldnt talk together on my old isp router
<zid> then it was firewalling itself
<zid> the network topology allows it
<clever> all wireless clients are isolated and can only get internet
<zid> because.. if it didn't.. it couldn't route
<clever> there is no off button, the docs claim it doesnt even support it
<_Heat> that's nuts
<clever> i suspect my ISP modified the firmware and added things
<_Heat> so each client gets its own little subnet
<clever> the logo is also all over the UI
<nikolar> _Heat: that's how wifi works at our work
<nikolar> *at work
<clever> _Heat: the IP's say they are in the same subnet, but the router just doesnt route packets between them
<_Heat> oh that's even weirder
<nikolar> i can't ping any other device
<_Heat> and possibly non-compliant
<nikolar> but it's fine over lan lol
<nikolar> well, ethernet
freakazoid332 has joined #osdev
<_Heat> modern games are so big i might actually need to get a proper networking setup
<nortti> oh?
<_Heat> 70 or 90GB take a while if I can get peak 80mbps
<_Heat> and I can't just take the desktop and connect it straight to the router
<nikolar> Why not
<_Heat> i mean it's a little big lol
<nikolar> What
<_Heat> what what
<nikolar> There's this thing called an Ethernet cable
<_Heat> i know, and my house is huge
<_Heat> i can't get an eth cable here without poking it through the walls
<nikolar> Get it through a window or something lol
<_Heat> basically the router is on one end of the house
<_Heat> and i'm on the other end
<_Heat> so you made my problem worse lol
<nikolar> Kek
goliath has joined #osdev
<nikolar> If your router is that far, you're lucky you got 80mpbs
<_Heat> i mean, the powerline works decently
<_Heat> i'm not on wifi, i can't get signal on wifi
<nikolar> Oh that's a thing people do
<nikolar> Re powerline
<_Heat> yeah
libercv has joined #osdev
<_Heat> it's neat but i'm paying for 500mbps
<_Heat> and getting 80 out of that is... ungreat
<nikolar> Indeed
<GeDaMo> I just have a really long cat6 cable :|
<nikolar> That works
<nikolar> Wifi absolutely sucks btw
<GeDaMo> I don't care about the cable dangling down the stairs :P
<nikolar> I hate it
<nikolar> GeDaMo: lol that's fair enough
<nikolar> As long as it's one cable
<GeDaMo> The router's downstairs, my computer is upstairs
<GeDaMo> I haven't even bothered tacking it to the wall :|
<nikolar> Kek
<nikolar> Some day, you'll step on it wrong and it will break, and pull wonder why
<nikolar> *you'll
<GeDaMo> Nah, it's straight down the stairs then around the wall
<GeDaMo> Having said that, there's a big pile of cable at the top, I should probably tie that up or something :P
<Ermine> _Heat: which distro you run now btw?
<_Heat> arch btw
<_Heat> i considered tumbleweed but i stayed with the safe option
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
<_Heat> TIL MoCA
<_Heat> this might actually work
xenos1984 has quit [Ping timeout: 268 seconds]
xenos1984 has joined #osdev
m3a has quit [Ping timeout: 245 seconds]
libercv has quit [Quit: Konversation terminated!]
<zid> henlo
<zid> I am back
<zid> Two things changed
<zid> My keyboard no longer goes 'boop beep' 'beep boop' when I move my legs
<zid> and the cable is 3cm shorter
<izabera> congrats on your surgery
<zid> It was touch and go, I was re-doing a splice and now the spliced end is honestly, too short
<zid> so it was incredibly fiddly and only barely worked :p
<zid> almost lost the patient, aka, almost had to take 10cm off and unscrew the keyboard
m3a has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
innegatives has quit [Quit: Connection closed for inactivity]
xenos1984 has joined #osdev
kata has joined #osdev
ionutc has joined #osdev
<ionutc> hello, does anyone have a risc-v kernel (preferably written in C) that uses SBI calls, that I could study? I am trying to use OpenSBI as a library to do BIOS-ey stuff but I can't figure it out.
<bslsk05> ​github.com: Onyx/kernel/arch/riscv64/sbi.cpp at master · heatd/Onyx · GitHub
<_Heat> it's remarkably simple
<zid> "load regs and do the call", hey, that's sort of sane :P
<_Heat> i don't use much else because why would i
<zid> not you, risc-v
<_Heat> i know
<_Heat> i'm not sane
<_Heat> SBI is a simple interface but then you have insane shit like the timer being under a magic syscall
<zid> good job
<_Heat> "SBI" syscall
<ionutc> Thanks a lot guys!
<_Heat> you're welcome
EmanueleDavalli has joined #osdev
EmanueleDavalli has quit [Quit: Client closed]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
goliath has quit [Quit: SIGSEGV]
Pixi has quit [Quit: Leaving]
Pixi has joined #osdev
ionutc has quit [Quit: Leaving]
parabirb has quit [Quit: WeeChat 4.5.2]
parabirb has joined #osdev
netbsduser` has quit [Ping timeout: 244 seconds]
goliath has joined #osdev
innegatives has joined #osdev
netbsduser` has joined #osdev
<geist> _Heat: i'm sad you didn't link LK
<geist> oh hah okay, yours basically cribbed mine. :)
<_Heat> :D
<_Heat> i just took the sbi call helper
<_Heat> not that there's much logic to the whole of sbi anyway
<geist> yeah i've been meaning to tighten that up so that it doesn't trash as many registers, but it involves more typing
<geist> i added some more code to at least probe additional extensions for lulz
<bslsk05> ​github.com: lk/arch/riscv/sbi.c at master · littlekernel/lk · GitHub
<_Heat> no one's using lk on riscv yet?
<geist> not publically at least
<geist> i think there's some project at work that's using it
<_Heat> trusty maybe?
<_Heat> for a random coprocessor
<_Heat> anyway i think you can get pretty compact with current riscv on linux
<_Heat> like, few megs and you get access to the whole linux ecosystem
<geist> word
<geist> i dont think i'm leaking anything in particular but the silicon validation teams that work on home built stuff at google love LK because it boots instantly (relatively speaking) to linux
<_Heat> oh cool
<_Heat> the apple people love linux
<geist> so when you have something in simulation or on a FPGA it might take like 2 hours to boot linux to just get to the command line to run some test thing
<geist> whereas on LK it's maybe 5 minutes
<_Heat> i suppose because it boots instantly relative to macOS
<_Heat> :p
<nortti> < _Heat> anyway i think you can get pretty compact with current riscv on linux ← apropos https://popovicu.com/posts/789-kb-linux-without-mmu-riscv/
<bslsk05> ​popovicu.com: 789 KB Linux Without MMU on RISC-V
<geist> so i've been working with the sival team a lot for various features and whatnot, and they've benen rolling things back on occasion
<_Heat> nortti: yep that matches with what i've heard
kata has quit [Read error: Connection reset by peer]
kata has joined #osdev
<_Heat> i can build a full gcc toolchain in 4 minutes now
<_Heat> 24 threads op
<_Heat> the whole of the onyx base system in 12 seconds
<nortti> when building the onyx base system, are you able to hit the full parallelism?
<_Heat> maybe?
<geist> awww yeah tiny oses rule!
* geist goes for a high five
<_Heat> the build is a little two staged, the kernel and musl don't depend on anything (musl depends on headers actually)
<_Heat> But user progs depend on musl
<zid> musl being *built* thought?
<geist> i need to get back to hacking on lkuser and just take the plunge and switch to musl
<geist> having a shit libc and no desire to write another one is holding me back
<geist> now i can probably just vibe code it
<_Heat> Vibe port musl
<geist> right, like... maybe it might work
<geist> tell it to just port the whole directory structure
<zid> Use the machine we invented that drinks its own piss vibe code, or vibe code as in, just wing it
<geist> or i can point it at onyx and say 'go do this plox'
<geist> and it'll be 'no can do kemosabe, that's gpl'
<_Heat> hahahahaha
<_Heat> hahahahahaha
<_Heat> hahahahahahaha
<_Heat> hahahahahahaha
<geist> and i'll be like 'damn heat, you got me now!'
<_Heat> cmon geist, an LLM that respects intellectual property?
<geist> haha, you think this is reality mang? it's been fiction this whole time!
<_Heat> poorly written fiction i'll tell you that much
<geist> fanfic
<geist> OR IS IT
<zid> geist heat slashfic
<geist> a forbidden love
<zid> makes a change from the usual heat/footballers
<zid> that he self publishes
<chiselfuse> i can't for the life of me figure out why 4a2000-4a7000 is loaded as `R` separately instead of just 4a2000-4a9000 as `RW` as i illustrate: https://pasteboard.co/WHAUu7cyw4kL.png
<geist> separated by a license
<bslsk05> ​pasteboard.co: Pasteboard - Uploaded Image
<_Heat> chiselfuse: post the whole readelf -a dump
<zid> if that has the .got.plt in it
<zid> it may have been the hardening
<_Heat> yeah
<_Heat> the relro
<zid> relro that's it
<zid> so, check the address of .got in the sections, ld.so may have done it later on. kernel loaded it rw, then ld.so remapped a page or two r only
<_Heat> i think i need to make my tlb invalidation logic pluggable by architectures
<_Heat> or even weirder...
<geist> oh you tried that whole unified mmu code thing didn't you?
<_Heat> yeah it works very well
<zid> It's actually just 4 full mms ifdefed 4 times per line of source though
<_Heat> my problem here is that in principle doing a tlbi + dsb sy kind of thing is a little different from the invlpg + IPI kind of thing
<zid> #ifdef MMU_A int page; #endif #ifdef MMU_B short page; #endif ...
<_Heat> so i need both for x86, switchable at runtime
<zid> [18] .data.rel.ro PROGBITS 00000000004a2e60 0a1e60 0040c8 00 WA 0 0 32
<zid> I win
<chiselfuse> zid: i don't understand. does this section affect where/how it's mapped or does it instruct the ld.so to remap something later on that makes it look like that?
<zid> yes
<chiselfuse> that's not a y/n question
<chiselfuse> which one?
<zid> the answer is yes to both
<zid> it affected how it's mapped
<zid> by instructing ld.so
<zid> to remap
<_Heat> geist: hey at least i realized a fun problem here before it happened
<_Heat> namely, that i need to keep track of pending tlbsync's in case i schedule out
<zid> don't ask me how relro is implemented, because I don't know, that's between glibc and ld.so and linux
rom4ik has joined #osdev
<geist> oh tabt's why you have a zen 4 now so you can dothe new stuff huh
<_Heat> yeah!
<chiselfuse> zid: but how? it doesn't have an INTERP
<_Heat> chiselfuse: glibc does it
<geist> my biggest machine is a zen 3. damn AMD for making perfectly good cpus that i dont need to upgrade
<_Heat> static PIE essentially needs a small ldso copy to do certain stuff
\Test_User has quit [Ping timeout: 252 seconds]
<zid> Actually kind of proud that I immediately thought of relro
<chiselfuse> zid is an oracle to me
<_Heat> actually i think this needs further work
<_Heat> namely regarding ASID support
<_Heat> you can only invlpgb a single ASID (or broadcast but lol)
<zid> asynchronous stealth intercept daemons, cyberbrain malware smh
<zid> heat why don't you do something fun, like unencrypting the keyboard
<_Heat> 😑
vdamewood has quit [Quit: Life beckons]
\Test_User has joined #osdev
Pixi has quit [Quit: Leaving]
Pixi has joined #osdev
<_Heat> welp i seem to have a bug on AMD
<_Heat> reserved bit set
<zid> don't do that
<_Heat> ohhhhhhhhhhhh ok
<pog> good job idiot
<zid> reads manual, "Never set this bit idiot", does it anyway, smh
<pog> i'm sorry you're not an idiot
<geist> oh one of those reserved bits on the higher page table? yeah
<_Heat> i'm not sure yet
<geist> that's always the first things folks trip over when trying to run on AMD the first time. i've been stymied by that one to
* _Heat checks the AMD manual
<geist> doubleplus check you do. the easiest way to do it is to assume you can set the global bit on all the levels
<geist> and no, you cant
<_Heat> G bit, hmm
<_Heat> lets check
<geist> it's not really inconsistent between AMD and intel iirc, it's just that AMD actually checks unused bits
<geist> but the G bit doesn't go all the way up, but iirc it's not just only on leaf nodes. it's weird
<geist> and i forget how it lines up with 5 level paging
<_Heat> #define KERNEL_PGTBL (_PAGE_PRESENT | _PAGE_WRITE | _PAGE_GLOBAL)
<_Heat> haha there it is
<_Heat> yep, it's running
<_Heat> now my tsc frequency can't fit into a u32 lol
<geist> yep, thought you would have booted on AMD before now, but i guess if you didn't have access to one
<geist> ah yeah that's right, for whatever reason the G bit only doesn'/t apply to the top level (PML4) but applies to lower ones https://github.com/littlekernel/lk/blob/master/arch/x86/64/mmu.c#L299
<bslsk05> ​github.com: lk/arch/x86/64/mmu.c at master · littlekernel/lk · GitHub
<geist> but... i dunno what happens with 5 level. probably same
<_Heat> apparently i've been setting the G bit on all user page tables
<_Heat> .. and nothing blew up
<zid> coinflip over whether 'same' means 'pml4 behaviour now applies to pml5, and pml4 now acts like pml3' or 'pml5 acts like pml4 did'
<zid> though
<_Heat> ah yes, because G is ignored there
<geist> well, i asked an ai and it said yeah pml5 it's the same as pml4 and cited the docs
<_Heat> geist and the G stands for googlepilled
<zid> Globally incorrect
<geist> lets see is there anything else about AMD that will trip you up... iirc the only thing that comes to mind for the basic stuff is the use lf long jumps in some way that AMD doesn't implement
<geist> though i guess you got past that. its why i pretty much always use retf for long jumps that set CS
<geist> something something 64bit long jump doesn't work or something like that
<geist> but you usually only use that in bootstrapping, so if you got that far
<_Heat> ok i've just hit a geist problem!
<_Heat> the fixed_point little header library i took from you can only divide a u32 by a u32
<geist> no did you only grab part of it?
<_Heat> none of the other funcs help
<geist> you can multiply by 0.x
<_Heat> i'm calculating nanoseconds per tick and ticks per nanosecond
<bslsk05> ​github.com: lk/lib/fixed_point/include/lib/fixed_point.h at master · littlekernel/lk · GitHub
<geist> oh i see, to compute the initial thing
<bslsk05> ​github.com: lk/lib/fixed_point/include/lib/fixed_point.h at master · littlekernel/lk · GitHub
<_Heat> right
<_Heat> so i'm doing the tsc conversion and getting 4.4GHz
<_Heat> which exceeds the u32, so it dies
<geist> yah i think all my uses and zircon's use of it is N per sec
<geist> and sec per N or so
<geist> though i say that i recently did some work in LK for this...
<geist> ah yeah still the same, i'm doing tsc to at best microsecs, so i still have another 1000 to have problems https://github.com/littlekernel/lk/blob/master/platform/pc/timer.c#L43
<bslsk05> ​github.com: lk/platform/pc/timer.c at master · littlekernel/lk · GitHub
<_Heat> no
<_Heat> you're getting silently wrong values
<_Heat> tsc_hz truncates
<geist> hmm, how you figure?
<geist> oh i see it. hrm
<geist> good catch
<bslsk05> ​github.com: lk/platform/pc/timer.c at master · littlekernel/lk · GitHub
<_Heat> msvc (the superior compiler) would warn on that
<geist> a little surprised gcc doesn't
<_Heat> C++ can if you enable -Wnarrowing
<geist> so the obvious question is if you make a 64bit version of that div function does it just continue to work. since i didn't write it i dont fully grok whats going on there
<geist> may be time to try to figure out precisely how all this code works
<geist> and yeah my main machine dopesn't return a TSC tick faster than 4.2 so i've never seen it
<geist> THE TERRIBLE CURSE OF NEW HARDWARE
kata has quit [Read error: Connection reset by peer]
goliath has quit [Quit: SIGSEGV]
kata has joined #osdev
<_Heat> i could finally switch over to linux's cycles mult + shift thing
<_Heat> which i do not understand
<_Heat> but i don't understand the fixed point stuff either
<geist> i just filed an issue with myself using AI https://github.com/littlekernel/lk/issues/448
<bslsk05> ​github.com: Fix possible 32-bit integer overflow in TSC to time base calculations (timer.c and related areas) · Issue #448 · littlekernel/lk · GitHub
<geist> honestly i dont know how i got it but i have the AI pro version on github, though AFAICT i'm not paying for it
<geist> i wonder if someone at github basically gifted it to me
<geist> i think at least? i dunno
<geist> ah i see, github pro "(free for some users)"
<geist> i guess there's some sort of bit you can have set on your account if you're a 'big' developer or something
<geist> "If you are a maintainer of a popular open-source repository, you may be eligible for free access to Copilot Pro. GitHub reviews eligibility for this based on project popularity and maintainer activity."
netbsduser` has quit [Ping timeout: 252 seconds]
<geist> https://docs.github.com/en/copilot/get-started/plans-for-github-copilot#:~:text=maintainers%20of%20popular%20open%20source%20projects%20may%20be%20eligible%20for%20free%20access.
<bslsk05> ​docs.github.com: Plans for GitHub Copilot - GitHub Docs
<nikolar> eww
<geist> eww yourself!
kata has quit [Quit: ZNC 1.9.1+deb2+b3 - https://znc.in]
kata has joined #osdev
Lucretia has quit [Remote host closed the connection]
<nikolar> no
vdamewood has joined #osdev
Turn_Left has quit [Ping timeout: 276 seconds]
theruran has joined #osdev