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
<heat_> oh and operator[] would not work here, i don't have exceptions
<zid> can you not just
<zid> make it return a 00 if it goes oob
<zid> and then you don't need exceptions
<zid> operator[]{ if(x > n) return 0; return a[x]; }
<heat_> sure, but anything else that reads it like a C string would be exploitable anyway
<heat_> say, strlen
<zid> fuck sake C++, be consistent
<zid> if I overload access to an object, do it for all accesses to the object
<zid> why are you such a half baked mess
<heat_> because i would be aliasing the object to a char *
<heat_> and that's on me
<zid> beaten wife syndrome
<zid> "It's all my fault"
<heat_> it's the downside of allowing type aliasing from and to char *
<zid> "he just gets angry when he's drunk, I should have known"
<heat_> 1) poor taste analogy 2) i'm not saying C++ is particularly well designed
<heat_> it's a mix-and-match of C and a new language
<zid> You blamed yourself
<zid> then said it was a part of C++ that you should have known to avoid
<zid> 100% victim blaming yourself
<heat_> i chose to use C++, i know its a language where you have 10000000 ways of screwing yourself over
<heat_> its just like writing C
<heat_> but... worse
<zid> my mouse is STILL charging
<zid> but I don't wanna take it off charge cus it will just die again next week if I do :(
<heat_> if i want truly bounds-safe indexing, i need to use a class + proper accessors. if i have a "const char *just_give_me_the_c_str()", that allows for unsafe indexing
<zid> I wasn't doing anything important so I should just let it
<zid> See that's where C++ is insideous, "It'd all be fine if I just USED MORE C++"
<heat_> C++ lets you do almost anything C lets you, which is why I can write a kernel in it
<heat_> i don't need to actively fight the language
Matt|home has quit [Quit: Leaving]
<heat_> and this is a pro and a con
<heat_> rust requires you to fight it in order to do anything that *might* be stupid, and that's 1) annoying 2) safer
<zid> yes but does rust provide RAT JUICE
<zid> I need more
<FreeFull> Rat juice?
<zid> > my mouse is STILL charging
<zid> We said RUST and someone I don't recognise appeared, must be the power of RUST
<heat_> your mice would've charged by now if it was written in RUST
<zid> ikr
<heat_> well, mouse
<heat_> unless you have more than one charging
<heat_> is it magic-mouse-like in that you need to turn it upside-down to charge?
Neo has joined #osdev
thenerd has quit [Quit: leaving]
<zid> no, but the cable is short
<zid> and I am too lazy to buy a longer one just for it
<zid> I can use it but I have to cross my arm over my chest, it's awks
navi has quit [Quit: WeeChat 4.1.2]
<FreeFull> heat_: I still don't understand why Apple did that
<FreeFull> I guess beauty over substance
<zid> cus apple, you got it
<geist> yeah that was pretty silly,but not sure where else you'd put it
<geist> i have the magic mouse that was the previous gen where it just takes AA batteries
<geist> wish it would charge
<zid> the.. side?
<geist> yeah but that's where your fingers are
<klange> how about the back
<klange> where a cable normally goes on a mouse
<zid> my mice all charge from around the perimeter
<zid> I've never had an issue
<geist> yeah but they'd have to change the overall shape in a negative way, relative to the previous gen
<zid> I used rechargeable AAA batteries in my last keyboard, I just had 2 x2 and swapped them with the charger when it got low
<geist> so the compromise is you plug it in every month or so for 30 minutes
<heat_> you have a magic mouse?
<geist> yeah totally, been using it for years. just the previous gen that takes AA batteries
<geist> otherwise it's identical
<zid> It seems significantly non-magical to me
<heat_> damn
<geist> you can't tell the difference without looking at the bottom
<zid> magic would be like, wireless charging off the mouse mat
<heat_> what do you like in it vs other mice?
<geist> oh i only use it on macs, but it has very nice gesture integration with macos
<geist> it only has 'one button' but the whole top of it is basically a gesture pad so it knows how many fingers based on what you're doing, etc
<geist> it's pretty neat once you get used to it
<zid> can you play factorio with it
<heat_> i like my steelseries GAMER mice
<geist> i have one in my bag for when i take my laptop somewhere, and another one next to my mac mini
<heat_> my aerox 3 seriously looks like a rainbow
<heat_> but it's pretty light and good and doesn't need charging
<geist> also it's pretty small, so doesn't really use up any space in a backpack
<heat_> i'm alergic to wireless stuff because I'M A GAMER SO I DONT WANT NONE OF THAT LATENCY TO GET IN TEH WAY OF MY GAMING
<geist> yah also remember the first magic mouse was released in 2009, so it's 15 years old now
<geist> heh, i'm allergic to wireless keyboards anywhere but my house. i do not trust BT security
<geist> mice i worry less about
<zid> weirdly there are wireless mouse with less latency than wired ones
<heat_> my new headset finally gave me a usb-c peripheral, which is cool
<zid> because the wired ones use usb1.0 and the baudrate is just so low that the packet takes longer to clock out
<geist> for gaming mice i just keep buying the same logitech thing with a bunch of buttons every 2-3 years when the buttons crap out
<zid> JVS arcade controls have this problem
<geist> i really should find a new one next time
<zid> they're 115200 baud, which means 1ms of delay per buttons packet
<geist> but usually i just need a new mouse and since there arent any brick and mortar stores to shop for mice around here...
<heat_> i wonder if the arm processor in my mouse is too small to run linux
<heat_> probably
<heat_> but, yknow, one can hope
<zid> mine are all cortex-m0s
<geist> yah that's about what i'd expect
* pogspawn chomps mouse
<heat_> my cat likes eating plastic
<pogspawn> mm microplastics
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nyah has quit [Quit: leaving]
<zid> Anyone from 2024 listening to this masterpiece!? Upvote if you are!!1one
<adder> What masterpiece?
<zid> linux ofc
<pogspawn> i'm listening to 2010's synthpop
<zid> I'm listening to phil collins
<adder> B.I.G.
<zid> do you think the guy in sussudio is quentin tarantino?
<bslsk05> ​'Phil Collins - Sussudio (Official Music Video)' by Phil Collins (00:05:16)
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
Starfoxxes has quit [Ping timeout: 252 seconds]
<heat_> do you think phil collins shot tupac
<zid> 100%
<zid> I think quentin tarantino helped
<adder> Tupac actually lives in a small village in Serbia.
<zid> all villages in serbia are small
<zid> 20 people live in the entire country
<heat_> TUPAC IS A SERB
<bslsk05> ​www.reddit.com: Blocked
<heat_> ronald serb
bradd has quit [Ping timeout: 260 seconds]
Starfoxxes has joined #osdev
Harzilein has joined #osdev
<Harzilein> hi
<heat_> hi
masoudd_ is now known as masoudd
air has quit [Ping timeout: 240 seconds]
Matt|home has joined #osdev
air has joined #osdev
edr has quit [Quit: Leaving]
pogspawn has quit [Ping timeout: 260 seconds]
incog has quit [Remote host closed the connection]
heat_ has quit [Remote host closed the connection]
heat_ has joined #osdev
heat_ has quit [Ping timeout: 246 seconds]
bradd has joined #osdev
sbalmos has quit [Ping timeout: 272 seconds]
sbalmos has joined #osdev
jack_rabbit has quit [Ping timeout: 272 seconds]
jack_rabbit has joined #osdev
dead1 has joined #osdev
<dead1> ##space
<zid> No thanks.
<dead1> oops
FreeFull has quit [Ping timeout: 272 seconds]
FreeFull has joined #osdev
<Mondenkind> #kernal
<zid> Rarely is one wave by itself
alpha2023 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
alpha2023 has joined #osdev
knusbaum has joined #osdev
jack_rabbit has quit [Read error: Connection reset by peer]
masoudd has quit [Quit: Leaving]
<gorgonical> #kernal
dead1 has left #osdev [#osdev]
asarandi has quit [Quit: WeeChat 4.1.1]
asarandi has joined #osdev
knusbaum has quit [Ping timeout: 272 seconds]
Matt|home has quit [Quit: Leaving]
zetef has joined #osdev
jbowen has quit []
jbowen has joined #osdev
vdamewood has joined #osdev
zetef has quit [Remote host closed the connection]
goliath has joined #osdev
<Ermine> #kernal
CutieMelo has quit [Read error: Connection reset by peer]
CutieMelo has joined #osdev
vdamewood has quit [Quit: Life beckons]
air has quit [Ping timeout: 268 seconds]
GeDaMo has joined #osdev
<Ermine> Are there 32-bit armv8-a?
<Mutabah> I think ARMv8 cores can run in IA-32 mode
gbowne1 has quit [Quit: Leaving]
neo|desktop has joined #osdev
Neo has quit [Ping timeout: 256 seconds]
mmohammadi9812 has joined #osdev
gog has joined #osdev
mohammadi9812m has joined #osdev
mmohammadi9812 has quit [Ping timeout: 256 seconds]
divine has quit [Ping timeout: 264 seconds]
zetef has joined #osdev
mohammadi9812m has quit [Ping timeout: 252 seconds]
zetef has quit [Remote host closed the connection]
<qookie> Ermine: in EL0 (and potentially EL1 i think?) you may be able to run 32-bit code if the core you're on supports it (apple silicon doesn't for example)
CutieMelo has quit [Ping timeout: 252 seconds]
air has joined #osdev
[Kalisto] has quit [Quit: Ping timeout (120 seconds)]
<qookie> ah EL2 can also potentially be 32-bit, but EL3 is always 64-bit
[Kalisto] has joined #osdev
CutieMelo has joined #osdev
Gurkenglas has joined #osdev
<clever> qookie: on the rpi5, EL1 must also be 64bit, but EL0 can be either
<clever> it basically means that all of the system control stuff, can ditch 32bit compat features
<qookie> oh no more people running 32-bit rpios on their rpi5s?
<clever> its capable of it, but the recommended configuration is pure 64bit
<qookie> ah right 32-bit rpios still shipped a 64-bit kernel, it's just userspace that was 32-bit right?
<clever> exactly
<clever> and its even armv6 32bit!!
<clever> because the 32bit image has to work on the pi1, and they dont want to confuse the user with armv6 vs armv7 vs armv8
<qookie> yeah
<clever> also, for the longest time, some things like the netflix drm widevine, was being "stolen" off a 32bit chromebook
<clever> so there was no 64bit binary you could load into a 64bit chromium
bauen1 has quit [Ping timeout: 264 seconds]
<clever> qookie: another neat benefit, on the pi4, the peripherals had to be within the lower 4gig of the addr space, to be reachable by 32bit kernels in pre-mmu mode
<clever> and that shadowed some ram
<clever> with the pi5, that concern is gone, so they can take advantage of the 64bit addr space, and put it several TB up
vdamewood has joined #osdev
<qookie> well you could work around that by using the dtb overlay
<qookie> dt-overlay=peri-high or something like that
<clever> that has to be paired up with undocumented control registers, that move the peripherals up
<clever> but now a 32bit kernel cant even touch peripherals until the mmu is on
netbsduser has joined #osdev
<qookie> well the stock bootloader automatically sets the regs up if you load that overlay
<qookie> and yeah it'll break 32-bit kernels completeely
<clever> yep
<clever> but if the cpu just doesnt support 32bit kernels, you dont need to support that low peri mode
<qookie> alternatively you can break all kernels by setting arm_peri_high=1 without using the overlay :^)
<clever> i think that flag loads the overlay automatically
<qookie> not according to the docs, the overlay sets the flag but not the other way around
<clever> ah
<clever> have you seen the custom mmu on past models?
<qookie> the one that maps ram into the vc4 addr space? i've seen it mentioned in diagrams but haven't had a proper look
<qookie> er not the vc4 addr space, legacy peripheral addr space
bitoff_ has quit [Ping timeout: 256 seconds]
<bslsk05> ​github.com: lk-overlay/platform/bcm28xx/arm/arm.c at master · librerpi/lk-overlay · GitHub
<clever> qookie: basically, you just have 64 pages, of 16mb each
<clever> for each page, you write the addr it maps to on the VPU bus
<clever> this is what changes the peripheral address on the entire pi0-pi3 family
<clever> ive booted a pi3 with peripherals at 0x2000_0000
<clever> and ive booted a pi1 with peripherals at 0x3f00_0000
<qookie> interesting, in the file just above i can see you map it both to 0x3f.. and 0x20.. :^)
<clever> being lazy, and covering all of the bases
<clever> but i could also picaso the entire addr space :P
<clever> every 64mb page maps to a different part of ram
<clever> respect dma-ranges or crash!
<clever> i could even randomize it on every boot
<clever> no cheating, respect dma-ranes!!
<qookie> also i wonder if i should bother checking the mmu mappings when dealing with the framebuffer on the pi4, the gpu gives an address in the addr space mapped by this mmu, and for now i'm just subtracting 0xC0000000 to get the real phys addr
<clever> assuming its a sane memory mapping, you can just clear the top 2 bits
<clever> subtracting could go negative in the future, and mess things up
<qookie> true yeah
<clever> but if you want to get better performance, you can just hijack the 2d core
<clever> its pretty simple
<qookie> yeah eventually i'll need to get around to that, but for just text logs a dumb framebuffer is more than enough
<bslsk05> ​github.com: lk-overlay/platform/bcm28xx/hvs/hvs.c at master · librerpi/lk-overlay · GitHub
<clever> here is a vc4 (pi0-pi3) example
<clever> you generate this 7 x 32bit structure, in a special region of ram
<clever> fill it up with as many of those structures as you want
<clever> then cap the list off with a 1 x 32bit of CONTROL_END
<clever> then tell the hardware, the index your whole list starts at
<clever> boom, your done, the 2d core is now displaying every image in the list
<clever> qookie: https://www.youtube.com/watch?v=JFmCin3EJIs that allows you to do this, with practically zero cpu usage, and locked to vsync
<bslsk05> ​'Chaos, 13 sprites randomly bouncing around' by michael bishop (00:00:12)
xenos1984 has quit [Ping timeout: 260 seconds]
qookie has quit [Remote host closed the connection]
qookie has joined #osdev
q3lont has joined #osdev
xenos1984 has joined #osdev
navi has joined #osdev
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bitoff has joined #osdev
q3lont has quit [Ping timeout: 276 seconds]
<Ermine> how is it supposed to work if function addresses in thumb-only mode should be odd, but instructions should be 16bit-aligned, i.e. be at even addresses?
<qookie> the lowermost bit is masked off, it's only used to indicate thumb vs arm mode
mmohammadi9812 has joined #osdev
q3lont has joined #osdev
mmohammadi9812 has quit [Ping timeout: 260 seconds]
q3lont has quit [Client Quit]
pretty_dumm_guy has joined #osdev
<Ermine> okay, thank you
<clever> Ermine: basically, bit0 gets loaded into the thumb vs arm mode register, and the actual PC just ignores bit0
CutieMelo has quit [Ping timeout: 264 seconds]
<clever> some opcodes like eret and bx, can do that
<clever> others like b just assume the mode is the same, and blow up in your face if it isnt
CutieMelo has joined #osdev
bauen1 has joined #osdev
<Ermine> okay
<Ermine> but somewhy chip gets into usagefault with invstate and dumped pc pointing at my entry point
<clever> Ermine: the main entry-point? an irq entry? a normal function? which chip?
edr has joined #osdev
<Ermine> it's a reset handler
heat_ has joined #osdev
heat_ is now known as heat
rustyy has quit [Quit: leaving]
Gurkenglas has quit [Quit: Client closed]
_whitelogger has joined #osdev
Nixkernal has joined #osdev
goliath has quit [Quit: SIGSEGV]
elastic_dog has quit [Quit: elastic_dog]
elastic_dog has joined #osdev
<bslsk05> ​twitter: <IanCutress> 'The REAL cost of x86 legacy is not (logic) gates, it’s lots and lots of meetings' ␤ ␤ hah
<zid> who the fuck going to meetings about x86 legacy
<zid> can I go
rustyy has joined #osdev
sympt has quit [Quit: Ping timeout (120 seconds)]
eschaton has quit [Quit: ZNC 1.8.x-git-43-6af32bbf - https://znc.in]
eschaton has joined #osdev
sympt has joined #osdev
dzwdz1 is now known as dzwdz
Matt|home has joined #osdev
divine has joined #osdev
<Ermine> wut
<zid> heat
<GeDaMo> wheat
<zid> The alt-left is very interested in taking shortcuts, the alt-right is very íntéréstéd ín ácúté áccénts
<heat> zid
<heat> FRED
<zid> where!?
<heat> you'll need to go to those x86 legacy meetings to find out
<zid> I want to!
<heat> ugh not even qemu supports FRED yet
<heat> you need to use fucking simics
<zid> which is precisely why I laughed so hard when everybody panic'd over x86s
<zid> like bro, if we see this before 2040 in obscure servers I'll be impressed
gog is now known as pogspawn
<heat> i didn't panic, i just think it sucks
<zid> I think it's perfectly reasonable
<heat> it needs a good redesign
<zid> but yea, whether all the details are holisticly sensible idk
<zid> but cutting out protected mode ring 0 is like.. perfectly fine for modern chips
<heat> oh, sure
<heat> you know, i wouldn't be surprised if most of the "x86 legacy meetings" stuff is going back and forth to individual OS vendors and asking for comments
<heat> "oh this part of FRED doesn't fit well with the NT kernel, can you cut that out?"
<heat> why does no one ask me for comments
<heat> "FRED sucks, send me CPUs"
mmohammadi9812 has joined #osdev
<mjg> i can appreciate someone trying to whack the legacy bullshit
mmohammadi9812 has quit [Ping timeout: 264 seconds]
<heat> mjg: re LEGACY bullshit, the linux slab guy is now using local_lock for teh slab percpu thing i talked about some months ago
<heat> they figured out disablign interrupts sucks and so does cmpxchg128 :))
<mjg> i bet it would be faster in rust
<heat> and the spinlock is mega-slower
<mjg> rust spinlocks are 0 cost
<mjg> i mean it's all abstracted and abstractions are 0 cost
<heat> negative cost abstractions
<mjg> did you know that rust surpasses amdahl's law on the regular?
<mjg> fuckin' amazing
<heat> anyway i'm now wondering if disallowing kmem_cache_alloc in interrupts is actually possible
<heat> at least as a feasible CONFIG that could be set on some platforms
<mjg> yo uwould have to assume that no
<mjg> but then again, it should be possible to make this shit fast regardless
<heat> indeed, but good drivers should already do all their work in bh through softirqs/tasklets/threaded irqs
<mjg> dude dafaq u takin' bout
<mjg> good drivers
<mjg> lmao
<mjg> don't forget to mention good firmware
<heat> so worst case you take the stuff that really needs to allocate and add a kmem_cache_alloc_irq
<mjg> look mofo they already messed up by allowing this shit to begin with
<heat> i know
<mjg> general mindset is that all routines should work from any context tho
<mjg> see fput
<heat> like, the best solution is to just use Onyx, which never allowed this to begin with
<mjg> noice
<heat> but until onyx world conquest we should fix linux
mmohammadi9812 has joined #osdev
<mjg> fair
pogspawn has quit [Quit: Konversation terminated!]
<heat> the slab percpu work + some maple tree patching has brk1 within ~3% of the old code
gog has joined #osdev
mmohammadi9812 has quit [Ping timeout: 276 seconds]
mmohammadi9812 has joined #osdev
thaumavorio has quit [Quit: ZNC 1.8.2 - https://znc.in]
thaumavorio has joined #osdev
mmohammadi9812 has quit [Remote host closed the connection]
<nikolar> heat btw musl's asprintf is a two pass implementation lol
<heat> ew
<heat> i guess they want to be really tight on memory
gog has quit [Read error: Connection reset by peer]
gog has joined #osdev
<zid> heat: https://en.wikipedia.org/wiki/RCA_1802 Found out why intel hasn't released it, legal troubles with RCA
<nikolar> Hasn't released what zid
<zid> FRED
gog has quit [Ping timeout: 246 seconds]
gog has joined #osdev
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
Gurkenglas has joined #osdev
navi has quit [Quit: WeeChat 4.1.2]
navi has joined #osdev
navi has quit [Client Quit]
navi has joined #osdev
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
bauen1 has quit [Ping timeout: 264 seconds]
bliminse has quit [Quit: leaving]
Floofy has joined #osdev
<Floofy> Hey guys, wassup.
bliminse has joined #osdev
<nikolapdp> hello Floofy
<gog> hi
<gog> omg a floofy
gog is now known as pogspawn
<Floofy> I have an issue with GDB, so I have the `-g` flag on all the gcc calls in my makefile, but when I go to debug it, GDB throws "no debugging symbols found". Anyone know of any workaround?
<pogspawn> i should group this nick but i think i have enough
<pogspawn> what are you debugging?
<pogspawn> are you sure your makefile's rules are the ones being run?
<Floofy> hang on, lemme make a gist
<Floofy> it's late, my brain isn't braining lol
<bslsk05> ​gist.github.com: OSDEV shit · GitHub
bitoff_ has joined #osdev
<pogspawn> your linker script discards your debug symbols
<Floofy> oh ok, what would I do to resolve that?
<zid> no it doesn't?
<pogspawn> err
<zid> You'd need /DISCARD/ for that
<pogspawn> oh i thought they needed to be included'
<zid> it will just put them after .bss
<zid> same with .GNU- nonsense etc
<nikolapdp> linker scripts accept everything that isn't explicitely discarded right
EineNdamen has joined #osdev
<nikolapdp> s/accept/include
<zid> Floofy: Do your .o files that you link together have .debug_ sections?
bitoff has quit [Ping timeout: 260 seconds]
<zid> and if so does, $(BUILDDIR)/kernel.elf also have them?
<zid> (we need to find where they've gone, either they didn't generate because you forgot to make clean first, or they got lost somewhere at link time)
<Floofy> >Do your .o files that you link together have .debug_ sections?
<Floofy> where would I find thaT?
<zid> readelf
<Floofy> lemme pull up the manpage rq
<zid> DESKTOP-VCLC0NQ ~/gameboy # readelf -S gameboy| grep debug
<zid> [29] .debug_info PROGBITS 0000000000000000 0000e33b
<zid> [28] .debug_aranges PROGBITS 0000000000000000 0000e2eb
<zid> ...
PapaFrog has joined #osdev
LostFrog has quit [Ping timeout: 256 seconds]
<Floofy> nope, they don't seem to?
<zid> make clean
<Floofy> lemme make a clean function in my makefile :D
<zid> or I guess in your case, rm -rf $(OBJDIR)/*.o
<pogspawn> zid are you clean
<zid> no
<pogspawn> go clean yourself
<zid> I've been abusing performance enhanging drugs, dr pepper
<pogspawn> me too
<geist> be very careful with lines like that in your makefile
<zid> in case it expands to nothing and you get /?
<geist> yes
<pogspawn> yes
<Floofy> *accidentally removes /lib*
<geist> i wouldn't -r it unless you need to
<geist> and always add a -- after the switches
<zid> you're right, $(RM) -rf --no-preserved-root $(OBJDIR)/
<pogspawn> do ./$(whatever) instead
<pogspawn> sksksk
<Floofy> AHAH! they have debug headers now, cheers
<sortie> zid: Please show yourself the root
<zid> dumbass, good luck :D
<sortie> *door
<Floofy> now to remember how to use GDB: - haven't used it since I started this project 5 years ago......
<zid> Oh look a kitty
<pogspawn> where
<Floofy> why 15yo me decided to build an OS is beyond me, but hey, it's fun!
<zid> pogspawn: In the other direction from answering questions about gdb
<zid> so if the questions are in your eyeline, keep turning
<pogspawn> zid i have pizza do you have pizza rn
<zid> I do not
<zid> I had two slices of shitty pizza earlier though
<zid> I want a proper pizza bad
<nikolapdp> who doesn't
<zid> The place that accepts online orders nearby is dominoes, and they want literally $100 for a pizza, you're supposed to stack special offers and order more than a single pizz and shit and it drops to $20 each
<Floofy> the fucking soundblaster driver was causing my OS to crash! WHYYYYYYYYY
<nikolapdp> zid: that's ridiculous
<zid> yea it is
<zid> OMG SUCH A GREAT DEAL is I guess what they're going for
<zid> but it's just irritating as shit
<zid> and prices me out of buying a single pizza
<nikolapdp> don't you have other pizza places
<zid> one, but the last time I tried nobody answered
<zid> and they only take phone calls
<zid> I'd rather have a toenail pulled out than use a telephone most days
<nikolapdp> why though
<zid> which thing, I said several
<nikolapdp> not using a telephone
<zid> who the hell likes telephones
<zid> strangers are bad enough
<zid> not being able to see them is 10x worse
<nikolapdp> lol
<nikolapdp> i wouldn't say i like them but i don't have a problem calling a pizza place to get pizza
<zid> You're not broken enough to be here then imo
<nikolapdp> kek
<zid> nikolapdp: phone the pizza place for me
<zid> they're used to polish accents
<nikolapdp> why would they be used to polish accents, are really that many polish people over there
<zid> yes?
<zid> like 4% of all people here are polish
<nikolapdp> huh interesting
<zid> same with lithuania, rest combined 3%, pakistan 3%
<nikolapdp> by here, you mean whole of uk or just your place
<GeDaMo> Quite a few Polish shops
<zid> my area
masoudd has joined #osdev
<zid> we're the capital (or were?) of polish immigration
\Test_User has quit [Quit: .]
<zid> large city near an agricultural center
<zid> they come here to pick vegetables and work in agro factories etc
<nikolapdp> i met a polish guy who works on a farm in scotland
<zid> also a very large amazon warehouse, and the general constant need for plumbers, dentists, etc
\Test_User has joined #osdev
<zid> idk what it's like recently though, last census was 2021
<nikolapdp> i mean that's pretty recent
<zid> yea but something rather important happened
<zid> that may have changed the UK's position re immigrant workers
<zid> idk if you heard of it, COVID
<pogspawn> i have polish friends
<nikolapdp> hello pogspawn
<pogspawn> hi nikolapdp
<zid> fuck, monitor crashed and forgot its nvram
<pogspawn> oops
<heat> pogspawn, netbsd
<pogspawn> i'm going to reimplement netbsd
<nikolapdp> why reimplement
<nikolapdp> just fix it
<heat> it's unfixable
<zid> Time to spend 20 mins trying to get through the menus fast enough before the OSD re-crashes to get the brightness back down from "10 million suns"
<pogspawn> all bsd suffers from being a direct descendant of og unix
<heat> >all bsd suffers
<heat> FTFY
<nikolapdp> lol
<pogspawn> we made a big mistake with software and that was software
<nikolapdp> indeed
<heat> software wasn't meant to be stressed
<heat> we're all about mental health but forget that when it comes to software
<zid> phew my trick got it
<zid> fullscreen a black window, monitor seems less stressed by that
<zid> I *may* need a new monitor.
<nikolapdp> yeah sounds like it
<zid> It works, 97% of the time, it just sometimes reboots, and the OSD is almost always hung :(
<zid> and monitors are expensive
<GeDaMo> No old TVs about?
<zid> old TVs?
<GeDaMo> HDMI?
<nikolapdp> yeah get a nice crt and plug it into your pc
<zid> I don't think my 1050ti will plug into a vhs combo
<zid> they removed the ramdac after the 9 series
<zid> I have a CRT on my desk, niko
<zid> it's just 1280x1024 and kind of out of focus
<zid> I use it to play arcade games and stuff
<nikolapdp> neat
<pogspawn> have you considered taking it apart and jamming an uninsulated screwdriver behind the suction cup
<nikolapdp> lol
<zid> pogspawn: Could do
<nikolapdp> while holding the metal part of the screwdriver with your fingers
<pogspawn> i'm just kidding please don't do this you will die
<zid> That was my plan for after honzuki is finished being translated
<zid> you won't *die*
<pogspawn> i feel like your monitor is old enough that it doesn't have a bleed resistor
<zid> it's just high voltage DC
<zid> 1280x1024 is modern AF
<zid> it's from the 00s
<pogspawn> oh
<zid> HDCRT with FAST PHOSPHORS
<pogspawn> i had a 1280x1024 viewsonic with a flat face
<pogspawn> i didn
<zid> yea it's a viewsonic
<pogspawn> 't like it
<zid> flat face = trinitron
<zid> sony patented it
<nikolapdp> fancy
<pogspawn> there was something wrong with the aperture grille, it was grainy on the left outer part
<zid> so anything with a flat face has to be licenced by sony under the trinitron name
<zid> could have been anything, not just the grille
<pogspawn> maybe
<zid> also fuck aperture grilles
<zid> shadow mask yo
<zid> (This is a lie)
PapaFrog has quit [Ping timeout: 272 seconds]
<zid> I actually found the exact model up from my CRT at the tip
PapaFrog has joined #osdev
<bslsk05> ​'A Tiny, Unlikely Full-Color CRT' by Cathode Ray Dude [CRD] (00:18:15)
<zid> but they wouldn't let me take it home
zid has quit [Read error: Connection reset by peer]
zid has joined #osdev
<zid> nikolar pls stop ddos
<heat> pogspawn, pogsix_spawn
<nikolapdp> zid what did i do
cow321 has quit [Read error: Connection reset by peer]
<nortti> must suck to live in the UK, where peers still have the power to reset your connection
<zid> I disconnected, did you not notice
<nikolapdp> i didn't actually, wasn't looking at the channel lol
<zid> (my ipv6 tunnel probably just blipped or something)
<heat> <nortti> must suck to live in the UK
<heat> FTFY
<zid> gotta have the sexy reverse dns on irc
masoudd_ has joined #osdev
<zid> nikolapdp why don't you have a sexy reverse dns!?
<pogspawn> how do i get rdns
<pogspawn> tell me tell me
<zid> install a dns server somewhere
<zid> delegate that IP range to that server
<pogspawn> that sounds boring
masoudd has quit [Ping timeout: 260 seconds]
<zid> make that server respond with "goggendorf.goggles.at"
<pogspawn> that's not my domain
<zid> nikolapdp: pick me a 4 digit hex number
<nikolapdp> 0x67ad
pog has joined #osdev
pog has quit [Client Quit]
<zid> Dns resolved 2001:470:1f09:1cfb::606 to goggles.dot.gog.dot.goggendorf.at
<zid> I could switch to it :p
<zid> .rs is boring
<pogspawn> i have a .is
<zid> nikolapdp: you like milosavljevic right?
<nikolapdp> who's milosavljevic
<zid> Slobodan Milošević
<nikolapdp> lol close enough i guess
<nikolapdp> sure, love him
<zid> *waits for it to propagate*
<zid> propogate?
<zid> stupid schwa
<pogspawn> proper gate
<zid> right, propagate, like propaganda
<nikolapdp> yeah exactly
<pogspawn> proper gander
<zid> .is is less boring than .rs
<nikolapdp> .rs is boring because of rust
<nikolapdp> screw rust
<nortti> spray screw with deoxit
<nikolapdp> lol
<zid> aww it got removed
<nikolapdp> what did
<zid> my sick Milošević domain reg
<pogspawn> dang a squatter owns gog.is
<nikolapdp> lol dang
<pogspawn> i'm warming up to this pogspawn nick
<nikolapdp> kek
<pogspawn> but it's not as punchy as gog
<zid> what is vucijarakija
cow321 has joined #osdev
<zid> wolf brandy!?
<nikolapdp> zid: it's a fruit spirit
<zid> fuck it
<nikolapdp> lol
zid has quit [Remote host closed the connection]
zid has joined #osdev
<zid> dns hasn't propagated yet, internet is terrible
zid has quit [Remote host closed the connection]
<nikolapdp> yeah had to deal with that at work a couple months ago
zid has joined #osdev
<zid> Now it has propagated, but libera's dns is slow, die
Gurkenglas has quit [Quit: Client closed]
<gorgonical> heat whas it you that said you can relink files in Linux after unlinking?
<gorgonical> who said that
<zid> yes he did
<zid> O_TMPFILE stuff
<zid> but it turns out linux can't
<zid> bsd can
<gorgonical> the SO answer I found says you can't reattach unlinked files
<gorgonical> yes
<zid> which was said in the same convo a few mins later
<gorgonical> I mean I don't particularly see why you shouldn't be allowed to relink a file. If you have a fd to data, why should linkat() care?
<nikolapdp> yeah heat said that too
<zid> which is basically what heat said
<gorgonical> I have been in and out of conversations recently. Sorry for retreading ground
<nikolapdp> no worries
<zid> He assumed it would work, mentioned it, then checked and said "huh, doesn't work, weird, there's no reason why not, it works for tmpfiles, and on BSD"
<zid> we're logged again now btw
<gorgonical> Oh I should have checked first, you're right
<gorgonical> I can happily say I fixed my cross-kernel implementation and now my sockets are real fast
<gorgonical> Just had to spend the wee hours of last night looking very hard at logs and timestamps to find the delays
<zid> libera's dns is slow and shitty.
<nikolapdp> kek
GeDaMo has quit [Ping timeout: 260 seconds]
zid has quit [Ping timeout: 256 seconds]
zid has joined #osdev
dude12312414 has joined #osdev
<nikolapdp> zid what's wrong with your dns
<zid> It's not my dns that's wrong, it's the kids who are wrong
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<nikolapdp> kek
pogspawn is now known as gog
devurandom has joined #osdev
<devurandom> Hey I am curious as to how a operating system would keep track of the userland stack pointer if it wants to jump to a specific function in a process. Currently my task switching works on a PIT which triggers a interrupt which stores stack pointer, instruction pointer which will be restored when returned from the handler. But if I want to trigger a
<devurandom> signal handler in a process how would I know what value would be safe to put the stack pointer at? Do I just have to keep track of the stack pointer of a process every single time a interrupt occurs or is there a better approach?
<zid> It wouldn't do that.
<zid> except fo r signals yea
<klange> the answer is still the same: you don't
<zid> just push rip onto the user stack then change its rip before you iretq
<zid> if you absolutely have to
<zid> note that's *return control to userspace* not *call a function in userspace*
<klange> if you are handling a signal on an alt stack, the old stack pointer goes on that alt stack,
<gog> don't call functions in userspace from privileged code
<zid> (we call those root exploits, btw)
<gog> hmm
<devurandom> Yes I meant jumping to them with a IRET or similar just like starting the ring3 program from the beginning.
<devurandom> of course not jump directly while in ring0
<zid> mov rax, user_rip; mov [user_rsp], rax; sub [user_rsp], 8; push rax; push [user_rflags]; xor rax, rax; iretq
<zid> should just about do it
<zid> exploitable still though
<zid> because of the unchecked access through a userspace pointer
<zid> (My memory suggests this has been a real CVE before)
<devurandom> I don't fully understand. So I would modify the signal handlers return pointer so that it points to the previous place it was interrupted at?
<zid> no?
<zid> I mean, sorta?
<zid> You're effectively injecting a call signal_handler()
<zid> oh on sysv you'd need to sub rsp, 128 because of the redzone
<zid> and the signal handler return would have to fix that
<zid> or you could just jmp into the signal handler, and have *it* do all that junk
<zid> rather than calling into it
<devurandom> sure but then I would have to keep track of the instruction pointer instead of the stack pointer so I know where the return from the signal handler has to jump to
<zid> You.. always have to keep track of that?
<devurandom> Yes but my interrupt does that for me
<gog> you basically need to build a dummy stack frame to return into
<zid> great, then it's already done
<devurandom> and it can be multiple different kinds of interrupts such as PIT or syscalls
<gog> the cpu doesn't know the difference, you are allowed to lie to it
<zid> not sure what PIT or syscall has to do with anything, your interrupt handlers/syscall handlers/etc must *all* save the user regs if they came from userspace
<zid> signals changes nothing
<devurandom> The thing is that I saw klange's (I think) signal handler putting something like 0xDEADBEEF as the returning instruction pointer and that would cause a page fault and the kernel could recover the userland from there. Then all I have to keep track of is the stack pointer I would have to set before doing a IRET to the signal handler
<devurandom> that was old kernel code
<devurandom> zid: Yes but then I have to keep track of that instruction pointer elsewhere since I have no clue where the original interrupt came from so I don't know where to look right?
<zid> you look in the task save area
<zid> where you stored it
<klange> i use 0x516 now because it looks like SIG
<zid> irq/syscall/nmi/schedule-switch/etc should all pack the regs back into the struct task{} with xsave or whatever
<klange> "normally" you'd have the signal bound to a "return" handler that would be in the libc or a VDSO or something, and it would a "sigreturn" system call, and then you'd shove that handler's andress in as the return address
<klange> but that's boooring
<zid> what if your syscall causes a task switch because read() blocked? what if your IRQ is the timer irq, and that causes one? You always wanna put the regs away safely
<klange> magic is so much more fun than not magic
<zid> you can't run any kernel code until you've done that else you're destroying them
<zid> so I'm not sure how you've managed to lose track of them
<klange> (the rest of how my signal stuff works is pretty close to, eg., Linux: you should have the context to return from the signal on the _user_ stack, carefully, and then pull it back off as part of sig-return, remembering that it is now untrusted user data)
<bslsk05> ​github.com: toaruos/kernel/arch/x86_64/user.c at master · klange/toaruos · GitHub
<bslsk05> ​github.com: toaruos/kernel/arch/x86_64/idt.c at master · klange/toaruos · GitHub
<klange> I wanted to do something more fun like a non-canonical address, but it turns out getting said address during such a fault is a pita
<devurandom> klange: I think I understand. So when you enter the signal handler you need to set the stack pointer at the correct location to avoid it overwriting data. That stack pointer you are using is provided in struct regs *r. But where do you get that stack pointer from? How is it updated?
<devurandom> do you do it every time you enter a interrupt?
<devurandom> because how else would you know where the user is currently at with the stack pointer in the program
<devurandom> that is the main problem that I am having. But it seems as if both of you are saying that is not a problem?
<klange> You can only be in the kernel from userspace through an interrupt or signal call, both of which provide you with the opportunity to collect the userspace stack pointer.
<devurandom> ok so you do keep track of the userspace stack pointer at the start of a interrupt? It seems as if in the start of the conversation you both said the kernel does not do that
<klange> the kernel does not do that
<devurandom> then who would collect it?
<devurandom> it gets put on the stack by the interrupt being called. But of course the kernel would have to put it in the process struct right?
<klange> the interrupt always pushes the stack pointer
<klange> no? why would it have to do that? it's always right there at the start of the interrupt frame, you just need to keep that around
<devurandom> ok so you keep track of the interrupt frame that keeps track of the stack pointer not just keep track of the stack pointer
<klange> not really, no, i only do that for the entirely unrelated process of changing another program's registers from attached debugger
<zid> Top tip, you have to save *all* the regs
<zid> not just the stack pointer, it isn't special
<zid> If you don't, your irq code is already broken, fix that first
<klange> I just process signals on return from the interrupt handler. I don't need to track anything because it's... the interrupt handler. https://github.com/klange/toaruos/blob/master/kernel/arch/x86_64/idt.c#L659
<bslsk05> ​github.com: toaruos/kernel/arch/x86_64/idt.c at master · klange/toaruos · GitHub
<devurandom> >it's always right there at the start of the interrupt frame, you just need to keep that around
<devurandom> it seems like you just said that you have to keep the start of the interrupt frame around. AKA keep track of the interrupt frame
<zid> the 'it' is not the interrupt stack frame
<zid> that'd be "it's at the start of itself"
<devurandom> zid: The interrupt keeps track of the registers. But I don't know where exactly on the stack they are put, just like you can be in a function and know that the return pointer exists but not know where on the stack it is since you don't know about previous allocations.
<klange> The interrupt frame from userspace is always just the "bottom" of the kernel stack for that process. There is no additional tracking. It's there. You're done.
<klange> I don't need to keep track of where my computer is because it's just right there at my desk. It will always be at my desk when I sit back down, even if I get up to get a soda.
<klange> If it's not, then something dreadful has happened and I'm probably going to die anyway.
<klange> Metaphorically speaking.
heat has quit [Remote host closed the connection]
heat has joined #osdev
<devurandom> ok so I always just read the top of the kernel stack and there is my stack pointer, instruction pointer and all that for the user. I did not consider that. So I don't need to "keep track of it" in a very strict sense since I just need to keep track of the top of the stack which of course I already know
[itchyjunk] has joined #osdev
gbowne1 has joined #osdev
bauen1 has joined #osdev
masoudd_ is now known as masoudd
<zid> Hello can I interest you in some literature about our lord and saviour, J.E.N.O.V.A.
<nortti> yes please. can you tell me why she's looks like that
<zid> Like a deity? Superiority.
<zid> Usually I don't make it this far when I am JENOVA's witnessing.
<nortti> I guess not enough people have played ff7
<zid> (That was just an excuse to make a jenova's witness joke)
<geist> heh i was about to make a ridiculous sword joke
<zid> Everything is a reference to Berserk, some just hide it better.
<heat> omg a signal handling question!
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
<heat> i missed it :(
<heat> signal handling is fucking tricky
<mjg> yo mama is a tramp
<mjg> sig tramp
<mjg> :X
<heat> comedy
<mjg> boomer humor
<heat> there was a recent proposal to make linux interruptible by default and shit
<heat> which was very rejected
<bslsk05> ​lore.kernel.org: [LSF/MM/BPF TOPIC] Replacing TASK_(UN)INTERRUPTIBLE with regions of uninterruptibility - David Howells
dude12312414 has joined #osdev
dude12312414 has quit [Remote host closed the connection]