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
<gog> ok
<gog> how about that osdev
<kazinsal> haven't done any in months
<FireFly> psch, as if anyone would come to #osdev for osdev
<FireFly> (sorry, I should stop shitposting in here)
dennis95 has quit [Ping timeout: 260 seconds]
<kazinsal> come for the hobby systems programming, stay for the feminization
friedy has quit [Ping timeout: 256 seconds]
zid has quit [Read error: Connection reset by peer]
<moon-child> FireFly: why? Nothing better to do
* gog passes out e2 patches
<gog> alright girls you know what to do now
<FireFly> techies love stickers, these ones just come with side-effects
zid has joined #osdev
<gog> side-effects may include breast tenderness and the desire to purchase a blåhaj
<moon-child> hrt monad
<FireFly> I have enough shorks already
<gog> shork
<gog> i don't actually own a blåhaj
<FireFly> !
<gog> i know
<kazinsal> I should get a blåhaj despite being a discount catboy vtuber instead of a catgirl
<gog> ikea is across town
<gog> icba
<kazinsal> yeah the nearest ikea to me is kind of annoyingly out of the way
<kazinsal> and apparently it's gonna start dumping snow tonight
<gog> ooof
<FireFly> kazinsal: they're comf either way, yeah
<zid> so what you're saying is you're gura
<zid> shark + catgirl
<kazinsal> no, no, shark + catboy. so discount rule 63 gura
dennis95 has joined #osdev
<gog> i'm also not into anime
* FireFly . o O ( numeric rules: internet rule or 1D cellular automata )
<moon-child> oh it's gonna snow tonight? Damn
<zid> kazinsal: Gura's dirty uncle
<FireFly> anyway, sleeptime, g'night
<kazinsal> c'mere kids we're gonna play some call of duty *beer cracking noise* nyaa--*belch*
<zid> that's just normal gura
<gog> nini FireFly
* kazinsal throws firefly a blahaj
<gog> i should go to bed soon too i have gym tomorrow
<zid> disgusting
<zid> Exercise should be reserved for life-threatening situations
<gog> it is a life threatening situation and my thighs will save lives
<kazinsal> become J U I C Y
epony has quit [Quit: QUIT]
<moon-child> I can't have a cat
<moon-child> landlord's policy
<moon-child> ;-;
<gog> ;o;
* gog moves in with moon-child
<gog> i'm cat now
<kazinsal> I can have a cat but my apartment is currently a nightmare of open-cased computers and loose wiring
<moon-child> :3
<kazinsal> so, no cat (yet)
<gog> cats love that stuff
<kazinsal> I do not want a cat nesting on my 3080
<geist> haha
* gog pets geist
<gog> geist is cat now
<geist> surprisingly my cat doesn't really go for warm things, but she's also long haired so i guess she's sufficiently warm
<geist> heat: hmm, what does set ucontext do?
<geist> is that basically the arch neutral versio of saying 'set gs'?
<zid> kazinsal: That's my cooling strategy
<zid> Noctua case fans are £28/each and make noise, leaving the side panel off is FREE
<moon-child> side panel? Of what?
* moon-child doesn't have a case
<zid> The plank of wood
<zid> that my mobo is screwed to
rwxr-xr-x has joined #osdev
<gog> hi 755
<rwxr-xr-x> yo gog
<gog> i'm thinking about buying a retro computer
<gog> idk what tho
<gog> or where i'd keep it
<rwxr-xr-x> i have no advice
<moon-child> my dad has an old apple ][ GS
<rwxr-xr-x> oooo
<moon-child> don't think he's touched it in years though
<gog> what if i got a zx spectrum
<rwxr-xr-x> that would be cool
<gog> it's the only retro computer i have space for, i don't even have a tv to connect it to
<rwxr-xr-x> 100 - 200 USD
<moon-child> I wanna azul box
<gog> i want a bebox
<gog> those are pretty rare tho
<gog> geist owns half of the ones that exist
<kazinsal> accurate
Terlisimo has quit [Quit: Connection reset by beer]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
<zid> Thermometers are just speedguns for atoms. Thank you for coming to my TEDx talk.
<rwxr-xr-x> damn
<rwxr-xr-x> that hits different
<rwxr-xr-x> and is true lol
Terlisimo has joined #osdev
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
<klange> I just replied to someone on the forum by quoting one part for their post, and then quoting another part. I love when people answer their own questions but don't realiz eit.
<zid> My favourite is when they researched something for too long without understanding any of it, and have like 30 contradictory made-up things they expect you to dismantle
<geist> yah i think there were about 1500 beboxes total. i dont remember what the split was between 66 and 133 mhz versions
<gog> which do you have?
<geist> and i do remember there were some ones with black plastic that were 200mhz, but they were never sold
<geist> i dont think they were totally stable
<geist> 133s
<gog> nice
<geist> they're not really that fast. iirc they were 603s, not 603es, and the issue was either the L1 or L2 cache had to be disabled in the chipset. i think L2
<gog> dang :(
<geist> because of SMP issues, so i do remember there were a lot of situations where disabling one cpu was faster
<zid> still true today
<geist> but there was the Pulse app on beos that showed instantaneous load of the cpus, and had a little button next to each cpu
<geist> so you could easily just turn one or more of the cpus off
<zid> My CPU is significantly faster if you turn all the APs off and up the multiplier :p
<geist> yah bt that's heat reasons probably, not SMP coherency issues
<gog> was this a soft off or did the cpu actually power down?
<geist> soft off, just was some syscall that descheduled particular cpus
<gog> ah ok
<geist> not really any reason one couldn't build an app like that on windows or linux, assuming it has the appropriate permission to do so, but with beos you were basically root
<gog> yeh
<geist> beos really was a pretty slick system at the time. especially compared to win9x and macos classic
<geist> it seemed myuch more like an advanced irix or nextstep
<gog> i used to use this one exec wrapper on windows to force cpu affinity because simcity 4 had issues with it
<gog> back when i got my first dual core
<geist> heh yeah i remember that too. had a dual core ppro back in college that i ran NT 4 on and was always tinkering with SMP
<geist> early exploration of OS kernel stuff basically
<gog> it wasn't that far back, this was like core duo :P
<geist> yah now that i think about i guess that q6600 i got somewhere in the mid 2000s was pretty much the first > 2 cpu machine i ever owned. that thing was a real trooper
<geist> though i ended up replacing it pretty quickly with some sort of 4 core athlon
rwxr-xr-x has quit [Read error: Connection reset by peer]
<geist> but i did always make a note of always having a SMP machine as my main box since about 1996-1997 when i got the dual ppro machine
<geist> only real step back was the brief period where i had a hyperthreaded P4 (the box i was fiddling with last month) though it was still technically SMP
gog` has joined #osdev
<geist> didja get kicked off?
<gog`> no I packed up my computer for the night
andreas303 has joined #osdev
nvmd has joined #osdev
gog has quit [Ping timeout: 252 seconds]
dennis95 has joined #osdev
andreas303 has quit [Ping timeout: 264 seconds]
dennis95 has quit [Ping timeout: 260 seconds]
heat has quit [Remote host closed the connection]
heat has joined #osdev
gog` has quit [Read error: Connection reset by peer]
gog has joined #osdev
andreas303 has joined #osdev
gildasio has quit [Remote host closed the connection]
dennis95 has joined #osdev
gildasio has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
epony has joined #osdev
<heat> geist, swapcontext is this old UNIX/POSIX thing you could use to swap user contexts
<heat> for i.e makeshift user threads
heat has quit [Ping timeout: 260 seconds]
dude12312414 has joined #osdev
gildasio has quit [Ping timeout: 255 seconds]
remexre has quit [Remote host closed the connection]
remexre has joined #osdev
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
gildasio has joined #osdev
remexre has quit [Remote host closed the connection]
remexre has joined #osdev
Clockface has joined #osdev
<Clockface> does x86 have an instruction for exponiation?
<Clockface> if it does, can i trust the compiler to use it when i call pow()
<zid> no, no
<zid> exponent has a pretty nice software trick to compute it fast though
<Clockface> what is it?
<Clockface> i cant use the bit shift one since im not doing ^2
<zid> You just decompose it into powers of two
<zid> n^7 is n^4 * n^2 * n^1 and n^4 is n^2 * n^2, and n^2 is n^1 * n^1
<zid> so for ^129 you can do it in a couple of multiplies instead of.. 129
<zid> etc
<Clockface> thanks
<zid> so basically just shift out the exponent, multiplying a running total by n each shift, and multiply the result by that total if the bit was 1
<zid> few lines total
<zid> for floating point.. hope the cpu can do it for you :D
<mrvn> for floating point it uses a power series.
<mrvn> Clockface: google for square and multiply algorithm
<Clockface> alright, im not using floating points this time around
<mrvn> f^f or f^i?
<mrvn> Note that even for long long int the exponent has to be really small. 0^x is 0, 1^x is 1 and for everything else n < 64 or it overflows. So there are really few factors you ever need.
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
smeso has quit [Quit: smeso]
eryjus has joined #osdev
eryjus has quit [Read error: Connection reset by peer]
smeso has joined #osdev
bradd has joined #osdev
<moon-child> avx512 has an instruction for exponentiation
<moon-child> (a fact which I'm sure will give zid great joy)
<moon-child> (hah, x87 has--well, not an exp instruction, but a log instruction. We really have come full circle)
<zid> x87 has trig, so avx is still bad
<moon-child> avx software trig is faster than x87 trig I don't make the rules
gildasio has quit [Ping timeout: 255 seconds]
gildasio has joined #osdev
<geist> yah in general i think youc an do trig faster with modern instructiosn than using builtins
<geist> i think that's why sse/avx doesn't have it. nor does ARM
<zid> at 32bit or 80bit?
* geist shrugs
<zid> (32bit is arguably more useful though)
<geist> i just remember looking at the benchmark numbers for a discreate vs builtin trig function thing on x86 and ARM and was surprised
<zid> 32bit probably needs so few rounds that it's trivial
<geist> yah
<geist> and really the builtins are just running microcode anyway, tey dont provide a number in one cycle
<zid> It'd be interesting to see an alternate reality cpu where the entire ISA was optimized down to 1 cycle, what the die size change would be, what beats avx now, blah blah, etc etc
<moon-child> I heard back in the early days somebody was able to do popcnt faster than the hardware
<zid> I wonder if it's basically free in terms of the former, but it's like any big software project and nobody is allowed to mess with legacy features, they're all on teams to add avx etc
<moon-child> what would be the point of taking everything down to 1 cycle?
<geist> trouble is one of the things that goes is you optimize everythig to 1 cycle, but now that cycle takes too long
<geist> so you trade IPC for CPS
<zid> I'd like to see a *current* breakdown of which ops break first under higher clocks too
<geist> or you mega pipeline stuff, ie the P4 method
<moon-child> zid: overclock your cpu, try out a bunch of instructions, and see what happens
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
<\Test_User> zid: easy, reduce clock to 1mhz, and do several parts in sequence within the 1mhz clock. 1 cycle :P
<zid> moon-child: It's hard to do that in isolation, lots of bios code and stuff runs first
<zid> and even beyond that, you need to do all the power management code + bench code yourself, bare metal
<moon-child> \Test_User: .oO( vliw time? )
<\Test_User> moon-child: multi-cycle vliw so future cpus can be happy to run more on the same code ;)
bauen1 has quit [Ping timeout: 265 seconds]
bgs has quit [Remote host closed the connection]
raggi has quit [Ping timeout: 255 seconds]
<mrvn> geist: wasn't that kind of the aim of RISC? Throw out the complex multi-stage/cycle opcodes and do them in software instead?
<mrvn> Also isn't anything (integer) but load/store/mul a single cycle?
k8yun has quit [Quit: Leaving]
k8yun has joined #osdev
<mrvn> zid: considering ram access when uncached is somewhere along 200 cycles how are you going to get a load down to 1? Make super fast ram? Slow down the cpu?
k8yun has quit [Quit: Leaving]
<geist> mrvn: right
<geist> and also avoid microcode because you can directly decode
<geist> note risc doesn't mean you can't pipeline it, but its effective throughput is one per cycle
<geist> also sure, if the cache isn't available you can't get it to 1, but you design it such that there is a cache and then try to get the cache hits high
<geist> also note there was risc as it ws in the 80s and risc as it is now, etc. a lot of the ideas are more general principles than hard rules like they were initially, which was intended to at the time make implementations easier because of this or that
heat has joined #osdev
<heat> morning operating system professionals
gog has quit [Ping timeout: 265 seconds]
gog has joined #osdev
raggi has joined #osdev
<moon-child> mul is 1 cycle throughput, if you count that
<mrvn> For my own CPU I have the ALU 74181+74182, which is 6 or 7 gates deep and the barrel shifter which is 13 gates deep I think. So I could make everything 1 cycle except for shift being 2 cycles.
<mrvn> A multiplication units has a far greater depth than that.
<moon-child> I mean, obviously an adder will have more span than, say, an xor
<mrvn> How do you do mul efficiently? You don't just take the first arg shifted AND bit of second arg and then sum them all up?
<mrvn> moon-child: not really. I mean you could have a dedicated XOR unit that's just 16 gates in parallel. But the 74181 has all the logic functions included.
<moon-child> 'how do you' dunno! I am not an rtl expert
<moon-child> but I know intel, and, and arm managed it somehow
<mrvn> You could do the N shifts and then an ALU tree. So that would only be log N deep. Or divide&conquer, doing a 16x16 mul by splitting it into 8x8 muls and so on.
<zid> 1 cycle mul is actually really easy
<zid> it just takes a bunch of wiring
<zid> It's the same as the log trick for pow except it's a tall af adder instead of having to shift and mul
<zid> (which makes sense, mul is to add as pow is to mul)
nyah has joined #osdev
Burgundy has joined #osdev
kof123 has joined #osdev
GeDaMo has joined #osdev
mykernel has joined #osdev
<mykernel> getting gpf(ring3 data) on iretq(timer irq) - ONLY ON AMD CPU (on hardware)
<mykernel> on bochs, qemu and two intel cpus everything is working
TkTech has joined #osdev
<mykernel> i have syscalls working(syscall/sysret works great) but if an interrupt fires (ONLY ON AMD CPU) i am fcked
<heat> this is the part where you link your interrupt handler asm
<bslsk05> ​github.com: mykernel64/irq_stub.S at master · aleksav013/mykernel64 · GitHub
<heat> you're not switching segments properly, you're not saving every register (which makes you rely on the compiler to do it for you in C code, which creates a very random register frame layout), you're pushing flags for no reason
<mykernel> ty
<heat> your interrupt stubs are huge, all they should be doing is pushing something and jmping to a common thing
<heat> s/something/the interrupt number and account for the error code/
GeDaMo has quit [Ping timeout: 265 seconds]
Burgundy has quit [Ping timeout: 268 seconds]
<heat> I also vaguely recall some tiny behavior being different in AMD vs Intel wrt segments
<heat> does it crash if you don't enter user mode?
<heat> wait, gpf ring3 data eh? I think you need to properly switch the ds, ss, es segments
<mykernel> it works if i dont switch
<bslsk05> ​github.com: Onyx/interrupts.S at master · heatd/Onyx · GitHub
<bslsk05> ​github.com: Onyx/interrupts.S at master · heatd/Onyx · GitHub
<heat> note how I don't load fs or gs because that overrides the GS and FS base MSRs
xenos1984 has quit [Read error: Connection reset by peer]
<heat> interrupt + iretq already deals with saving and restoring %ss too (that mov %ax, %ss is redundant I think)
GeDaMo has joined #osdev
xenos1984 has joined #osdev
bradd has quit [Ping timeout: 265 seconds]
<bslsk05> ​pastebin.com: diff --git a/kernel/src/cpu/irq_stub.S b/kernel/src/cpu/irq_stub.Sindex f8a05b - Pastebin.com
<mykernel> heat: is this what you meant?
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
nur has quit [Remote host closed the connection]
nur has joined #osdev
nur has quit [Remote host closed the connection]
<heat> ur missing rdi i think
<heat> but yes roughly that
<mykernel> rdi is there
<mykernel> still does not work :(
<heat> is your idt set up properly?
nur has joined #osdev
<mykernel> yeah everything is working correctly on 2 vms and 2 other machines on hw
<mykernel> quit()
<mykernel> oops
<heat> that doesn't matter
FreeFull has joined #osdev
<mrvn> zid: if you just stack adders then a 64bit mul would be 64 ALUs deep, or around 640 gates. That takes far too long.
<mrvn> zid: as a tree it would still be 6 levels deep I think and some of the adders would be bigger (and hence deeper) if you want 128bit result.
<mrvn> So mul takes 6-7 times as long to produce a result compared to add. If mul is 1 cycle then add would leave the cpu idle a lot of the time.
dude12312414 has joined #osdev
bgs has joined #osdev
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
gog has quit [Read error: Connection reset by peer]
gog has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
fatal1ty has joined #osdev
<fatal1ty> Operating System Development
<fatal1ty> Operating System DEVelopment
<fatal1ty> where the real chads are hanging out
<fatal1ty> mjg: not a word
xenos1984 has quit [Ping timeout: 252 seconds]
dennis95 has joined #osdev
andreas303 has joined #osdev
xenos1984 has joined #osdev
<gog> evening folx
<GeDaMo> Hi gogx :)
<gog> gogx???
<gog> how is that pronounced?
<gog> gogcks or gog-ecks
<gog> that g-c glottal stop is kinda tough
<kazinsal> goch with a rolled ch
<gog> hm yes
<kazinsal> like "loch", but a catgirl instead of a body of water
<GeDaMo> That was my thinking :P
<GeDaMo> Isn't Van Gogh pronounced like that too?
scoobydoo_ has joined #osdev
<Ermine> gog: may I pet you?
<gog> Ermine: yes
<sbalmos> gagh
<sbalmos> best served alive
<gog> q'plah!
* Ermine pets gog
<gog> with blood wine
* gog prr
<sbalmos> and Rokeg blood pie
scoobydoo has quit [Ping timeout: 260 seconds]
<gog> yes
<gog> i want a pet targ
<fatal1ty> gog: what happened to meow ?
<Ermine> pet thargoid?
scoobydoo_ has quit [Ping timeout: 265 seconds]
<bslsk05> ​memory-alpha.fandom.com: Sehlat | Memory Alpha | Fandom
scoobydoo has joined #osdev
heat has quit [Remote host closed the connection]
heat_ has joined #osdev
gildasio has quit [Ping timeout: 255 seconds]
gxt has quit [Remote host closed the connection]
gildasio has joined #osdev
gxt has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
<Jari--> hows your Ferrari purchasing going?
<geist> happy tyrs day!
<sbalmos> you didn't bring tacos?
<kazinsal> man now I got a hankerin for taco bell
<sbalmos> *ding*
<kazinsal> nearest one's way far away though
<geist> yah same
<geist> next one is a town over
scoobydoo has quit [Ping timeout: 256 seconds]
scoobydoo has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
heat has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
<gog> í morgunin er oðinsdagur
terminalpusher has joined #osdev
<zid> you penguined odin's daughter
<fatal1ty> so much wierdness
<fatal1ty> you guys suppose to be the gangsta's of 2022 !
<fatal1ty> im disappointed
<fatal1ty> i don't want to take part in this Cock party
elastic_dog has quit [Killed (silver.libera.chat (Nickname regained by services))]
elastic_dog has joined #osdev
fatal1ty has left #osdev [BYE]
<zid> nice
<GeDaMo> :|
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<geist> heh, mission accomplished
<kof123> yes, let the record show that after fatal1ty left the festivities began <motions to log bot>
<kof123> as it is written, they will end upon rejoin. thank you log bot
<geist> yay really bad ping lag today. upstream i assume
bgs has quit [Remote host closed the connection]
epony has quit [Quit: QUIT]
terminalpusher has quit [Remote host closed the connection]
<gog> hi
<Ermine> hi again gog
<zid> gig again, ho
<Ermine> gigagog
<heat> man
<heat> did I miss the cock party?
<sortie> we used to have kool trollz in here
<heat> now we just have cock parties to which I am not invited
<sortie> heat, it's just functional programming
<sortie> Not a cool orgy
<sortie> I learned that the hard way
<heat> aw
<heat> everything but functional programming
nlocalhost has joined #osdev
<heat> sortie, member when you said you were going to exploit my BPF jit? I'm fulfilling my end of the bargain
<heat> you better start having ideas with spectre
<sortie> hot
<heat> where's your BPF implementation sortie
netbsduser` has quit [Remote host closed the connection]
netbsduser` has joined #osdev
<gog> i'll write a BPF implementation
<gog> eventually
<gog> maybe
winlundn has joined #osdev
epony has joined #osdev
gxt has quit [Ping timeout: 255 seconds]
gxt has joined #osdev
winlundn has quit [Quit: Textual IRC Client: www.textualapp.com]
FreeFull has quit []
heat_ has joined #osdev
heat has quit [Ping timeout: 256 seconds]
heat_ is now known as heat
<kaichiuchi> hey kids
<gog> i'm an old lady
* gog shakes her cane
<heat> candy where
simpl_e has joined #osdev
* gog hands heat a bowl of unwrapped hard candies of unknown age that are all stuck together into one big lump
<bslsk05> ​cgit.freebsd.org: src - FreeBSD source tree
<mjg> i'm sure the bug was deliberate and now the patch is breaking functionality
<kaichiuchi> god -fsanitize=address is the best thing to ever happen
<kaichiuchi> just had to deal with a segfault and the call stack was nowhere near where asan detected a fault
<heat> facs
<gog> i need to play with that
<kaichiuchi> and I was pulling my hair out
<heat> step 1) -fsanitize=address
<heat> step 2) compiler do magik
<heat> step 3) runnnnnnnnnnnnn
<gog> do you need any support code in kernel?
<gog> or doess the com
<gog> piler do all of it
<heat> for a kernel or for userspace?
<gog> kernel
<heat> oh sweetheart, you need plenty of support code
<gog> oh
<heat> so basically you can lookup my AWESOME SUPER NICE KERNEL for some codez
<heat> but the gist of the thing is that the compiler expects some functions to be present __asan_{load, store}_{1,2,4,8,N}
<gog> ook
<heat> but ofc it's more complicated
<heat> compilers have a inline asan stuff (which FWIW you can fully disable) which expect a linear shadow map at $ADDRESS and they just codegen the whole check, which gets you a bigger binary but some really nice perf boosts
<heat> oh yeah note that the shadow map is a (1:8) map that says if it's fully accessible (byte = 0), partially accessible (1...7 for the first N bytes) and special not-accessible values (redzones, freed memory, etc, all up in the negative int8_t space)
<heat> this also means that you can't directly touch non-kernel (lower half) addresses in KASAN instrumented code because the shadow map will only cover the upper 128TB
<heat> oh and -fsanitize=kernel-address is usually what you use for the kernel, it's lighter and more geared towards (linux) kernels
<heat> the whole complex shadow map shit goes away if you look at userspace because you can just mmap (128/8)TB and rely on overcommit
<gog> yeh makes sense
<gog> and the compiler can rely on a lot of library being present
Burgundy has joined #osdev
brynet has quit [Ping timeout: 252 seconds]
gordea has joined #osdev