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
LittleFox has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
LittleFox has joined #osdev
sortie has joined #osdev
sortie has quit [Remote host closed the connection]
dutch has joined #osdev
gildasio has quit [Ping timeout: 255 seconds]
gildasio has joined #osdev
Vercas has joined #osdev
sortie has joined #osdev
_poisond has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
epony has quit [Ping timeout: 268 seconds]
<kaichiuchi> it’d be fine they said
<kaichiuchi> whatever that was took forever
<bnchs__> systemd be like
<bnchs__> what did you expect bro, systemd takes forever to shutdown
<bnchs__> it's one of the weaknesses it has
<geist> yeah i have sometimes trouble with ubuntu where it sits there on a few of the shutdown hooks for minutes. never have figured it out
<bnchs__> or maybe something they backported from windows
<geist> some race somewhere
<bnchs__> because lennart works for m$ now
<geist> oh haha, someone saying M$. how cute
<jjuran> It's always "now", so it's not wrong
* geist has flashbacks to the 90s
<bnchs__> s/now/after 10 hours/
<jjuran> "MicroSloth Winblows!"
<geist> you missed a $ opportunity there jjuran !
<geist> Micro$loth that is
<jjuran> Mi¢ro$loth
<bnchs__> my brain is deep-fried
<bnchs__> AMA
<heat> micro$hit loseshit
<jjuran> Deep-fried sounds yummy
<jjuran> On the other hand, a mind is a terrible thing to taste
<bnchs__> jjuran: 200% same
<bnchs__> i would eat anything deep-fried
<geist> oh yeah LOSEDOSE forgot about that one
<sortie> $GOOG
<jjuran> Which makes no sense at all out of context (los dós?)
<bnchs__> microsoft won't add inches to your....
<bnchs__> nevermind
<sortie> won't anyone think of the shareholder value
<geist> into your ass
<geist> infect the planet with RUUUUUUUUUST and then shoot your dead vulcans at it
<heat> no one say a word about $GOOOOOOOOOOOG
<heat> we must protect our osdev friends' shares value
<bnchs__> so you gotta rust rust rust, gotta rust rust rust, gotta rust rust rust.. forever!!!!
<geist> oxidize your children for run and profit
<heat> ST
* sortie closes the bar
<geist> sounds like a real... cargo cult here
<sortie> Go home everyone you're drunk
<sortie> You don't have to go home but you can't stay here in your home
<bnchs__> sortie: hey bro, i still need aaa drink man
* sortie throws bnchs__'s drink in their face, starts a fight
<geist> we'll just go out to sorties sauna
<heat> towels or no towels?
<bnchs__> hahahaahaa tooo obadd it was empty!!
<sortie> Sauna? Last time I went to Helsinki I got chased out of there by two people wanting my suitcase
<geist> i thought all You People had saunas by default
<geist> i mean it's all thes ame thing right?
<moon-child> gonna make an avx512 version of rust and call it
<bnchs__> moon-child: too hard
<heat> i'm gonna make a microcode version of rust and call it ʳᵘˢᵗ
<bnchs__> i'm gonna make rust and call it shit version of iron
<heat> you mean micro$hit rustblows
<moon-child> I'm gonna make an italian version of rust and call it 𝑟𝑢𝑠𝑡
<jjuran> bnchs__: Will it run on an SGI O2 machine?
<geist> oh that's true, i think MSFT is into rust now too. doesn't that put some of the micro$loth stank on it?
<bnchs__> jjuran: it just rusts your SGI machine
<heat> even NSA is into rust
<heat> <cue all seeing eye>
<geist> oh no! if they use rust they'll actually be competant at domestic surveillance
* geist waves to friends in domestic surveillance
<heat> ladies and gents, we have defeated terrorism with rust
* geist gestures subtly towards heat
<bnchs__> i'm gonna make rust, and call it C++ with even shitter syntax
<sortie> jet fuel can't melt rust
<geist> to get meta for a minute, joking about rust is like joking about kids these days. you rip on them but you're really just feeling obsolete and a little jealous.
* geist sighs
<geist> but will continue my tirade against rust! we must hold strong
<bnchs__> i was wondering why retroarch froze, and firefox refused to play videos
<bnchs__> apparently audacity was still taking control of my speakers
<heat> i will never be obsolete
<geist> hmm, i kinda thought al gore invented rust along with the intenret
<heat> i am inevitable
epony has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat> you can hold your unique_ptrs and your Boxes but I will arrive with my strong opinions about everything and a very intense NIH syndrome
<heat> i. am. osdev.
<geist> a walk in the forest in the dark
<geist> you hear a sound... what is it?
<geist> BEAR METAL
<epony> a wumpus
<epony> too late
<zid> shia lebouf
<bnchs__> shia le buff
<bslsk05> ​en.wikipedia.org: Hunt the Wumpus - Wikipedia
<epony> if you hunt the legacy, the wumpus hunts you
<kazinsal> ah, it's spontaneous basilisk postin time
<epony> spontagious
<epony> you can exercise your guess routine.. just imagine what you're missing (which you can't know)
<gog> i wonder what my FBI handler is up to
<gog> hey heat what are you doing rn
<epony> squats
<kazinsal> federal bureau of icelandvestigation
<geist> sauna enforcement force
<epony> infeasibility
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<gog> i do not want to meet the sauna enforcement force
<epony> it's of course wrongly spelled to coinfuse you
<heat> gog, im playing football manager
<gog> why
<kazinsal> no saunas to enforce
<epony> it's not federated but pederal it's not bueaureuaucacocracy its bastadisation and it's not infissibility it's involvement
<heat> because I like to pretend I'm a football manager
sortie has quit [Quit: Leaving]
<gog> that sounds terrible
<aoeiu> but why would you want to manage a football
<epony> and you thought CM was Chess Master, eh?
<heat> i kinda wish I was one tbh
<gog> magnus carlsen, not cagnus marlsen
<epony> take that, you feeble pimplefaced chestnut maiden
<gog> i am not feeble
<aoeiu> girl works out
<aoeiu> she could body slam your weak shit
<gog> hey now
<epony> carlson the magnussifent
<aoeiu> do u even lift bro/sis/sib
<epony> lift pawns get queens
<gog> that's right
aoeiu is now known as AoeiU
<geist> re2c: discuss
<heat> ok the uefa c course is pretty pricey
<heat> ~650 euro
<heat> ://
<heat> i'm not gonna become a football manager for now
<AoeiU> oh no :<
<epony> you can still train your legs with OS programming
<epony> try to use vi and the legs instead of arms, you'll make a good programmer with a bit of practice
<epony> keep the head goal score for special occasions though
<epony> special points for a football haircut
<epony> you like the crazy people from twin peaks
matrice64 has joined #osdev
<epony> cast your votes for the best haircut to wear with a turban
<AoeiU> that's a damn good cup of coffee
<epony> no, it's a fez
<AoeiU> oh, so it is
<AoeiU> i beg your pardon
<epony> why are you talking french all of a sudden
<epony> sudan
<AoeiU> sacre bleu
<AoeiU> wir sind nicht die Franzoeschen ihr sucht!
<AoeiU> Franzoesen*?
<epony> ok droids move along move along
<AoeiU> pog we made it through
<bslsk05> ​'Beginning Opening First Scene Your Men are Already Dead - Matrix (1999) - Movie Clip HD Scene' by Legendary Movie Scenes (00:03:05)
<heat> gog pog
<kazinsal> gogchamp
_poisond has quit [Ping timeout: 268 seconds]
<epony> Cython: You weren't supposed to relieve me.. Trin: I know but I felt like taking a shit.
<gog> heat bazinga'
<epony> count the number of gassings
<bslsk05> ​'Fart within the Matrix (The Full Video)' by TheGreatDeadpoolio (00:04:33)
<moon-child> gonna make an avx512 version of the big bang theory and call it
<epony> big banging fury
<mrvn> Has anyone ported Hunt the Rumpus to RUST?
<epony> maybe it should be renamed to hump the rusters
<epony> or rust the humback
<epony> the crustiest segfaults in the whole functional universe
<heat> geist, did you manage to get rid of the got and plt in your --export-dynamic thing?
<geist> not yet, was fiddling with the reserved memory thing
<geist> got sidetracked
<epony> for a moment thought you were talking about http://gameoftrees.org/
<bslsk05> ​gameoftrees.org: Game of Trees
FreeFull has quit []
<moon-child> everyone, be careful not to say anything, otherwise epony might free-associate it into something completely unrelated
<Reinhilde> :D
<Reinhilde> moon-child: epony can probably be accurately emulated in Lisp
<zid> markov chains are old hat
arminweigl has quit [Ping timeout: 252 seconds]
<Reinhilde> I don't mean markov chains
<Reinhilde> I mean that epony is simple enough that they can be accurately represented as some hundreds of thousands of lines of Lisp code
<Reinhilde> bump it up into the low tens of hundreds of thousands (1-2 mill) for C.
<Reinhilde> though if you are writing an AI in C you are certifiable.
<moon-child> c has if statements, doesn't it?
<Reinhilde> yes
<Reinhilde> it even has switches
dutch has quit [Quit: WeeChat 3.7]
<heat> no, only loops
<heat> and trigraphs
<moon-child> #define if(x) for (int dummy = 1; dummy && x; dummy = 0)
sweetleaf has joined #osdev
<Reinhilde> for (;dummy;)
<Reinhilde> probably
<Reinhilde> save the set operation
<bnchs__> moon-child: #define if(x) for (int dummy = 0; !dummy; dummy >> 1)
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<epony> Reinhilde, at which grade were you discarded from school ;-)
<epony> (landing on your head)
<epony> your Niebellung masculinity is showing
<epony> you'll have to e-mule-ate self-castration jokes too
<epony> dating back to Kronos times, you know harversting the monads
<Reinhilde> accursèd
<epony> now work some more on your Lisping
<Reinhilde> yeah no that'd just be while what i wrote
<epony> cause it sounds a bit snakeish
<epony> imagine if that initial socialist test-sickle was the first closing bracee of your old testamentality Lisparsersperger
<epony> quite islamic when you figure out it's the crescent and star after all
<epony> don't you think, Hilda?
<mrvn> moon-child: now build switch/case
<moon-child> hmmm
<moon-child> do I get to use setjmp/longjmp?
isaacwoods has quit [Quit: WeeChat 3.7.1]
<epony> no, just register shifts and forward-reverse control but you get 256 registers to play with and not a single memory instruction
<bnchs__> use raw opcodes to jump
<bnchs__> epony: 256 registers
<bnchs__> alot than intel's 8 registers
<epony> yep, for all your 256 miffle fingers
<epony> "meddle"
xenos1984 has quit [Read error: Connection reset by peer]
<bnchs__> no i still not gonna forget about intel's shit registers
<epony> they were 6
<bnchs__> no they were 2
<epony> that's another Intel
<epony> from MOStek
<heat> what's a shit register?
<heat> I didn't see those in the SDM
JerryXiao has quit [Ping timeout: 260 seconds]
<epony> a shit register is what you use on SONET-SDH
<kaichiuchi> god
<kaichiuchi> recursion is annoying
<mats2> is it?
<mrvn> bnchs__: number 1 and number 2?
<kaichiuchi> i do not write recursive code and this is nice
<kaichiuchi> change my mind
<mats2> is it?
<moon-child> recursion is nice
<epony> a-ha
<kaichiuchi> :(
<moon-child> I recently wrote a concurrent ring buffer as a (tail-recursive) function. Was much easier to reason about the state involved than it would have been with an explicit loop
<epony> for when you want to make longjumps from the top of the jumping tray in a waterless pool
<epony> the computer does not have a problem with it
<epony> it's the premise of computing to do all kinds of iterative bit flipping
<epony> you get the effects of that pre and post usage (if you have time to wait)
<epony> maybe you would know why it was invented at least?
<epony> guesses?
dennis95 has joined #osdev
andreas303 has joined #osdev
xenos1984 has joined #osdev
<epony> oups, wrong channel.. just kidding, if / when you figure out why recursion is implemented and not used but actually required, scratch a couple of lines indicating you have had an epi©phoney
c2a1 has quit [Ping timeout: 260 seconds]
__fastcall has joined #osdev
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
dennis95 has joined #osdev
andreas303 has joined #osdev
<mrvn> Newtons 4th Law of Thermodynamics: No good deed goes unpunished.
<matrice64> /win 9
dabios has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
dabios has quit [Quit: leaving]
knusbaum has quit [Ping timeout: 272 seconds]
SGautam has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
knusbaum has joined #osdev
heat has quit [Ping timeout: 252 seconds]
GeDaMo has joined #osdev
immibis_ has quit [Remote host closed the connection]
immibis_ has joined #osdev
arminweigl has joined #osdev
danilogondolfo has joined #osdev
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Ping timeout: 252 seconds]
UncleBen has joined #osdev
Burgundy has joined #osdev
dennis95 has joined #osdev
andreas303 has joined #osdev
Burgundy has left #osdev [#osdev]
bnchs__ has quit [Ping timeout: 272 seconds]
sortie has joined #osdev
bnchs__ has joined #osdev
bnchs__ is now known as bnchs
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
<kaichiuchi> hi
<zid> did you remember the warm this time
<kaichiuchi> i'm getting my space heater today
<zid> so not only did you not bring the warm, you have plants to get your own private warm supply
<zid> and are boasting about it
<mrvn> all your space heater belong to us
<kaichiuchi> :)
UncleBen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
UncleBen has joined #osdev
Burgundy has joined #osdev
poisone has joined #osdev
terminalpusher has joined #osdev
wereii has quit [Quit: ZNC - https://znc.in]
wereii has joined #osdev
JerryXiao has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
gildasio has quit [Ping timeout: 255 seconds]
gildasio has joined #osdev
terminalpusher has quit [Remote host closed the connection]
[itchyjunk] has joined #osdev
UncleBen has quit [Quit: salvia]
<dzwdz> does anyone here have any idea what unit ext2's i_blocks is measured in?
<dzwdz> from the source code it seems like it's the cluster size / 512
<dzwdz> but that just raises more questions than it answers
nyah has joined #osdev
<dzwdz> can't really find any good docs on the topic either
sham1 has quit [Ping timeout: 252 seconds]
<dzwdz> oh wait it's just meant to count the size / 512b
<dzwdz> nvm, i'm stupid
sortiecat has joined #osdev
sham1 has joined #osdev
spikeheron has joined #osdev
sweetleaf has quit [Ping timeout: 272 seconds]
andreas303 has quit [Ping timeout: 252 seconds]
dennis95 has quit [Ping timeout: 265 seconds]
elastic_dog has quit [Ping timeout: 252 seconds]
elastic_dog has joined #osdev
Terlisimo has quit [Quit: Connection reset by beer]
Terlisimo has joined #osdev
andreas303 has joined #osdev
dennis95 has joined #osdev
<kaichiuchi> i swear to god the "connect with another client" feature on irccloud is worthless
<bnchs> damn
<kaichiuchi> "Error from server: Closing link: Authentication temporary error, try again" 9 times out of 10 on every system I own
<kaichiuchi> it's a them problem
__xor has quit [Read error: Connection reset by peer]
<epony> which god did you swear to?
<bnchs> the computer gods
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
poisone has quit [Quit: joins libera]
__xor has joined #osdev
gog has quit [Quit: byee]
gog has joined #osdev
<kaichiuchi> virtualizing windows 98 is impossible
<kaichiuchi> jesus christ
<Ermine> So far VMWare Workstation virtualized it best.
<kaichiuchi> that's what I'm using on Linux
<kaichiuchi> explorer just page faults even with patcher9x
<kaichiuchi> hilariously on windows it works fine
<__fastcall> Did you try qemu
<kaichiuchi> no
<__fastcall> Probably the best :>
<Ermine> __fastcall: the best for actual operating systems probably. I tried win98 under qemu, and this is painful.
<jimbzy> Win98 was pretty painful on hardware, too.
<jimbzy> It worked great right up until it didn't.
<__fastcall> Ermine: what exactly is painful haha
<Ermine> __fastcall: sound is horrible, shutdown does not work, for example.
<__fastcall> Ah
<Ermine> I don't really blame qemu for this. It's win9x fault.
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
dennis95 has joined #osdev
andreas303 has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
<bnchs> kaichiuchi: still working on the gb emulator?
<kaichiuchi> of course
<kaichiuchi> i want to make it work on garbage hardware
dude12312414 has joined #osdev
<bnchs> yeah
dude12312414 has quit [Remote host closed the connection]
AoeiU is now known as theWeaver
<bnchs> i'm working on my cdi emulator
spikeheron has quit [Quit: WeeChat 3.7.1]
sweetleaf has joined #osdev
Vercas9 has joined #osdev
Vercas has quit [Ping timeout: 255 seconds]
Vercas9 is now known as Vercas
Griwes has joined #osdev
FreeFull has joined #osdev
<zid> bnchs: comisserations
<zid> going for retail game level accuracy, or low level accuracy?
pie__ has quit []
vancz_ has quit []
<bnchs> zid: WINE level of accuracy
pie_ has joined #osdev
vancz has joined #osdev
<zid> heh
<bnchs> i'm going for reimplementing the OS lol
<zid> cdi HAL
vancz has quit [Client Quit]
pie_ has quit [Client Quit]
<bnchs> i'd like to show my code here, maybe as a review
<zid> If it's written in C I can show you all your missing statics
<bnchs> yeah it is
<bnchs> zid: https://codeberg.org/KiwiCDi have fun looking at the horrible mess i made
<bslsk05> ​codeberg.org: KiwiCDi - Codeberg.org
vancz has joined #osdev
pie_ has joined #osdev
<zid> what do I click
<zid> I've never even heard of this website
xenos1984 has quit [Ping timeout: 260 seconds]
<bnchs> it's a git hosting service
xenos1984 has joined #osdev
<zid> okay so: doesn't work in my normal browser, in chrome the font is tiny and they've somehow disabled zoom
<zid> loving it so far
<bnchs> wtf, how tf do they disable zoom
<bnchs> zoom works for me in firefox
<zid> it also just.. stops scrolling and goes white, then a while later new content pops in
<zid> oh it does zoom it just takes about 2-3 days
<zid> this website is *fucked*
<zid> probably doesn't help that it's a 10000 line file
<bnchs> what file are you looking at
<zid> ..please tell me that uniquely identifies which file it is
<bnchs> CPU emulation?
<zid> I'm desperately to know what m68k_in.o's .text size is
<zid> s/ly/
<bnchs> yeah that's a CPU emulation engine (musashi) i didn't write lol
<bnchs> but i did modify it a bit
<zid> It looks like an absolute nightmare
<zid> well for main.c I have many many complaints at least
<bnchs> tell me
<bnchs> btw it's just some temporary main file i threw together to test out the program
<jimbzy> Well, for starters it's written in Pascal, not C... ;)
<zid> mixture of declarations and code, missing static qualifiers, random mix of C++ and C style pointer declarations, make_hex as a whole
<zid> so is there anything I can look at?
<zid> main is thrown together, musashi you didn't write
<bnchs> make_hex i took it off of musashi's example
<bnchs> i guess look at os9
<zid> oh this has code in it
<zid> and I spy a static!
<zid> memory_context is a global, that seems risky
<bnchs> i'm planning to change that
<zid> are the os9_ ones the 'cdi os' ones you're reimplementing, or the underscore ones?
<bnchs> the 'cdi os' ones i'm reimplementing
<zid> all your ()s should be (void)s
<zid> 65 on memory.c as an example
<bnchs> alright
<zid> I'd probably bump that big while in memory_allocate to a new func called 'find_block'
<bnchs> memory_context is basically just a pointer to a memory pool, used for the allocation, deallocation, and CPU memory accessing functions
<zid> so you end up with blah = thing(); if(!thing) os9_errno = E; ... all the way down, which'll look pretty
<zid> and the find function's existence will act like a nice comment for what that loop is doing
<bnchs> that's a good suggestion
<zid> 86 on process.c is sketchy af, just do the two byte writes
<bnchs> shit i forgot about that
<zid> and nobody would give a shit if you had called 'buf_pointer' just 'p'
<zid> I saw an /* Pointer to the end */ char *end_pointer; earlier too.. just call it end
<zid> *p++ = 0; *p++ = A; very idiom
<bnchs> but i think it's supposed to be 0x000D in big endian and 0x0D00 in little endian
<bnchs> so that it'll look the same in memory (0x00 0x0D)
<zid> that's why the code is sketchy as fuck
<zid> it breaks aliasing rules so that it can do the *wrong* approach, as far as I can tell
heat has joined #osdev
<bnchs> hmmm
xenos1984 has quit [Ping timeout: 246 seconds]
<bnchs> what's the right approach
<zid> What's the goal, just having 00 DD in memory?
<zid> 00 0D*
<zid> line 29/35/etc suggest that it is
<bnchs> yeah, for the CPU
<zid> what I said, then
<zid> there's no endian in that, it's a 2 byte array
<zid> not a 16bit value
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
<zid> memcpy(n, "\x0\xD", 2); if you wanna be weird about it
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<bnchs> alright, i'll change that
<bnchs> thanks :)
<heat> zinger
<zid> the loop on 91 doesn't make any sense to me
<zid> i starts as 0, then you increment i by 2, then test the parity of i
<zid> = 0 and += 2 cannot change the parity of i to odd
<zid> it looks like it was meant to be i++
<zid> so that you alternate betwen two code paths
<bnchs> oh yeah, i added that i += 2 during some early point in development
<bnchs> must have forgotten to change it
<zid> but that's the dumb way to write it, the i += 2 way is correct, you just have no if() inside and do thing[i+0] = 0; thing[i+1] = 0xD; or whatever op you're doing
<zid> same issue as before on 109, 113 is wrong wrt aliasing but at least correct wrt it being an endian issue at least
<zid> repeat until end
<bnchs> alright
<zid> the correct primitive is memcpy, not casting to u32 *
<zid> or just writing a WRITE_U32 macro
<zid> that does p[0] = high_byte; p[1] = ..;
<zid> personal style thing: spaces after the sizeof keyword, it's an operator not a function
<heat> you could just cast to u32 * if -fno-strict-aliasing
<zid> potential bug source that probably needs a documentary comment; You do pid++ on entry to process_new, even if the syscall fails, idk if that's correct behavior wrt the original
<heat> actually good q
<heat> what's the behavior on that for fork()?
<bnchs> no that's a mistake
<heat> if you create a new process in fork and then ENOMEM somewhere what should be the next pid?
<zid> six
<heat> ah POSIX doesn't require sequence in pids apparently
<zid> that's the best part about emulation
<zid> spec doesn't matter, what anyone can write a test-rom to have happen does
<zid> "I wrote a test rom that relies on pid sequencing staying sequential even if it fails 3/4 of the way through fork, glhf"
<bnchs> the OS api calls are implemented in trap_handlers, if you wanna see that
<zid> we should watch non non biyori clips on youtube now I think
<heat> i'm 0/3 on "teams I want to win" world cup edition
<heat> fml
<zid> who won?
<zid> Was it me?
<heat> no not the ingerland
<zid> I meant me personally
<heat> also not zid no
<heat> it was the anti-ingerland, the argentinians
xenos1984 has joined #osdev
<zid> who did they murder
<epony> the turkey
<jimbzy> Le Blue
<zid> les bleux
wootehfoot has joined #osdev
<epony> there is a long arrow in this chicken
Raito_Bezarius has quit [Ping timeout: 268 seconds]
<epony> pooq poq poq poq france lost poq coq pooq poq poq 1 week of Xmessi celebrations now #10
terminalpusher has joined #osdev
danilogondolfo has quit [Remote host closed the connection]
<kaichiuchi> hi
<heat> hello
dennis95 has joined #osdev
andreas303 has joined #osdev
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
Raito_Bezarius has joined #osdev
ZombieChicken has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
<kaichiuchi> you know
<kaichiuchi> I wonder how logging on embedded systems goes
<zid> serial
<kaichiuchi> yes
<kaichiuchi> that's all well and good
<kaichiuchi> that part I know
<kaichiuchi> but sometimes you can't do that
<heat> LEDs
<kaichiuchi> heat: hey by the way
<kaichiuchi> I have another task for you
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
<kaichiuchi> i have a heap, right? and this heap accepts structs which contain functions to call
<kaichiuchi> and these structs are in an array
<kaichiuchi> how can I possibly do the lambda magic now
<kaichiuchi> with templates
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #osdev
<kaichiuchi> (i don't think you can)
terminalpusher has quit [Remote host closed the connection]
<bnchs> kaichiuchi: isn't that called the stack
<kaichiuchi> no
<kaichiuchi> I literally mean a heap data structure
<bnchs> oh
heat__ has joined #osdev
<heat__> kaichiuchi, pointer
heat_ has quit [Read error: Connection reset by peer]
heat__ is now known as heat
<heat> actually
<heat> hrm
<kaichiuchi> pointers are a candidate
<heat> you'll need a pure virtual class invokeable or something that has an operator(), then a subclass of that that encapsulates a lambda and has an operator() that invokes the lambda's operator()
<kaichiuchi> i hate this.
<heat> that's the only way here
<heat> you need to do type erasure
<kaichiuchi> what a horrible fucking language
<kaichiuchi> okay
<heat> void * doesn't work because lambdas don't subclass anything (i.e you can't just operator() them out of the blue)
<heat> you'd have this exact same problem in C sweetheart
<kaichiuchi> no I wouldn't
<kaichiuchi> I would just do `event_handler func;` and be done
<heat> and have a void *ctx?
<kaichiuchi> rather that than this monstrocity
<heat> you store 2 pointers instead of one
<kaichiuchi> unless this can all be better abstracted later
<heat> you're like literally implementing std::function bit by bit
<kaichiuchi> and it's awful :)
<heat> this is the part that needs dynamic memory allocation (you don't know the size of the lambda beforehand)
<kaichiuchi> I can't do that
<heat> i guess you can skip that in this case
<kaichiuchi> skipping what?
<heat> dynamic memory allocation
UncleBen has joined #osdev
<heat> yeah totes
<heat> you would only need malloc if you're doing this lambda shizzle with std::function
<heat> because you can't reliably know how large your lambda is, so you can't just store a static buffer in std::function
<heat> pure function calls are ez, just a function ptr (8 bytes), member functions are ez, just a fptr and a pointer to this(16 bytes)
<heat> lambdas are hard, no way to know how much shit you're capturing
<heat> at least 8 bytes for the fptr, plus whatever state you have going on
<zid> I like it when C++ programmers remember pointers exist
<kaichiuchi> I just hope this can be better abstracted later
<zid> they spend all day doing std::max<std::max<std::vector<T>,std::span<T>>,std::container<T>> termplates
<zid> then remember arrays exist
<kaichiuchi> because this is just... a gargantuan nightmare
<kaichiuchi> if I wanted to fight with the language this much I'd write Rust
heat has quit [Remote host closed the connection]
heat_ has joined #osdev
<heat_> kaichiuchi, welcome to the C++ standard library
<heat_> thou ist reimplementing it
heat_ is now known as heat
<kaichiuchi> I couldn't give two shits
<kaichiuchi> this is absolute bullshit
<heat> wait until you see type_traits
<zid> did you implement all 17 variants of = yet
<heat> SFINAE if you're lucky, else compiler magic
<heat> gcc and clang have a shit ton of __builtin_ magic for type_traits
<kaichiuchi> yeah I've seen that
<heat> also, again, you can't complain that people dont give a crap about the hardware while desiring a language that abstracts everything for you
<zid> I was talking to a C++ dude about something and he was genuinly having to do something like that?
<zid> oh it was new
<heat> this is actual C++, the language, no nice abstractions
<zid> new had 17 variants he had to implement, there was a big table
<heat> hm?
<bslsk05> ​en.cppreference.com: operator new, operator new[] - cppreference.com
<zid> sorry 22
<heat> no
<heat> 14
<zid> the other 8 don't count?
<heat> no
<heat> they're per-class overrides you can use
<heat> if you override operator new on a type T, new T will use that
UncleBen has quit [Quit: salvia]
<mrvn> heat: if you don't know how large the lambda is then how would you specify the size to malloc? Makes no sense. you have to know the size and the type and then you can have your buffer.
<heat> yes it does make sense
<heat> new invokeable_lambda<T>(<lambda>)
<heat> you don't know how large a lambda you can get, that's the point
UncleBen has joined #osdev
<heat> so doing char small_buffer[sizeof(void *) * 2]; and using that as a storage for type erasure is hard, although possible and maybe more efficient in many circumstances
<mrvn> heat: You do know how large that one lambda is. The problem is that each lambda is a unqiue type so you can't make a heap of different lambdas. You do need the type erasure and then you can make a heap of pointers of the type erased type. Or more likely a heap of type erased lambdas that contain a pointer to the actual lambdasd.
<heat> you should read the whole context
<heat> i'm talking about std::function...
dennis95 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<mrvn> you still don't need a pure virtual objects. That's just one of the ways you can erase types-
<heat> it's the obvious, better choice at least
<heat> and the one that is actually used by standard library implementations
<mrvn> arguably it's the simplest choice.
<mrvn> and well optimized in general
ZombieChicken has quit [Quit: WeeChat 3.7.1]
ZombieChicken has joined #osdev
UncleBen has quit [Quit: salvia]
<zid> heat: England won the world cup
<zid> England also lost the world cup.
<zid> France lost, but argentina won
<mrvn> we have always been at war with eurasia.
<epony> who? the muddles
fwg has quit [Quit: .oO( zzZzZzz ...]
<bslsk05> ​www.google.com: ugliest face in football - Google Search
<bslsk05> ​stackoverflow.com: pointers - std::function/bind like type-erasure without Standard C++ library - Stack Overflow
<kaichiuchi> “isn’t hard to write”
<kaichiuchi> my ass.
dennis95 has joined #osdev
<epony> on tv
<kaichiuchi> my ass is on tv?
nyah has quit [Quit: leaving]
ZombieChicken has quit [Quit: WeeChat 3.7.1]
ZombieChicken has joined #osdev
andreas303 has joined #osdev
<bnchs> what if you do
<zid> six
<bnchs> a function pointer, and you execute it
<zid> it'll never work
<kaichiuchi> I'm already too deep in this
<bnchs> no like, this isn't related to kaichiuchi's question but
<kaichiuchi> the fact that I have a folder called "gbstl" with replacements for std::array, and maybe soon to be std::function is *astounding*
<zid> "C++ programmer remembers pointers exist" is my favourite
<kaichiuchi> the major challenges so far have not been solving the problem, but getting things to work with the language as efficient as they can possibly can get
<kaichiuchi> -extraneous can
<bnchs> tbh at this point, i would be doing dynarec
<bnchs> but i forgot this is meant for shit machines
<kaichiuchi> well I plan to
<kaichiuchi> I mean, this is supposed to run on just about anything
<kaichiuchi> it's an exercise in target portability and getting something performant on shit hardware
<kaichiuchi> but of course, if it's running on a desktop, yes a JIT would be nice
<kaichiuchi> note: I did not say it was an exercise in *language/compiler portability*
<kaichiuchi> this is C++17 abusing the ever living fuck out of gcc/clang specifics
<bnchs> what are you trying to do in your emulator
<bnchs> events?
<kaichiuchi> yes
<kaichiuchi> if I had std::function this would've been over by now
<kaichiuchi> and honestly, this "event scheduler" is not as efficient as it could be
<bnchs> what does your emulator do with your event scheduler
<kaichiuchi> it has everything to do with it
<kaichiuchi> handles timer updates, handles screen updates
<kaichiuchi> otherwise we're doing this in lock-step and that's not particularly efficient
<kaichiuchi> the drawback of how I'm doing this now, although it can be changed later, is the fact I'm just firing events even if the guest program doesn't actually give two shits about the result
<bnchs> but i don't understand what you're trying to do with std::function
<kaichiuchi> ah
<kaichiuchi> consider: scheduler_.AddEvent(Scheduler::Events::kTIMAIncrement, timer_speed, [](const int late) noexcept { func_that_handles_tima_increment; });
<kaichiuchi> er, *handle_tima_increment;
<kaichiuchi> without some actual bullshit, I can't pass a lambda with all of the fancy C++ bells and whistles
<bnchs> so that's it?
<kaichiuchi> yeah pretty much
<kaichiuchi> and the solution so far appears to be 100+ lines of noise
<bnchs> i would be doing that with a function pointer
<kaichiuchi> the alternative is doing what I was doing before: void* userdata; event_cb whatever;
<kaichiuchi> yeah but that's not idiomatic C++
<kaichiuchi> anything like void* userdata; is a `[this]() { ... };` construct
vdamewood has quit [Remote host closed the connection]
elastic_dog has quit [Ping timeout: 265 seconds]
vdamewood has joined #osdev
<bnchs> to be quite honest, i wouldn't give 2 shits
<kaichiuchi> I do though, in part because I'm learning about the inner monstrocities of what C++ actually is
elastic_dog has joined #osdev
<bnchs> yeah, well i learned something, that C++ seems way too shit
<kaichiuchi> I think once I figure out how to abstract this all in some neat way
<kaichiuchi> then it won't be so bad
<kaichiuchi> but the fact that I have to go through this at *all*..
sortie has quit [Quit: Leaving]
dh` has joined #osdev