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
<zid> watch out gog, he just potentially mutated you
* gog mutates
<gog> const gog &
<zid> gonst cog
nyah has quit [Quit: leaving]
Bonstra has joined #osdev
DynamiteDan has quit [Excess Flood]
DynamiteDan has joined #osdev
<mrvn> bnchs: that should be pet(std::optional(gog)) although I don't see why pet should ever be called with nullptr
<gog> pet should take a const reference
<gog> although i've seen cats mutate during pets
<mrvn> not const. petting mutates the petted.
<gog> anyhow it's bedtime
<mrvn> should it be gog.pet()?
gog has quit [Quit: byee]
<mrvn> what's the programming patern when you have an action between 2 objects? One doing the petting an one being petted?
<klange> ultimate cursed screenshot
zaquest has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
zaquest has joined #osdev
<mrvn> klange: at least the math seems to check out, according to apcalc and python3
<Mutabah> That is some quality curse
<klange> I had to add support for building kuroko without floating point support for limine, but we've got it working and integrated for EFI builds on x86-64, aarch64, and the experimental riscv64 port.
<klange> BIOS builds aren't working due to size constraints that are being looked at.
<klange> This started as a joke, but I always follow through on my jokes.
xenos1984 has joined #osdev
Matt|home has quit [Ping timeout: 248 seconds]
crash has joined #osdev
crash has quit [Client Quit]
vin has quit [Quit: WeeChat 2.8]
vin has joined #osdev
divine has quit [Quit: Lost terminal]
divine has joined #osdev
innegatives has joined #osdev
asarandi has quit [Quit: WeeChat 3.8]
asarandi has joined #osdev
rorx has quit [Read error: Connection reset by peer]
bradd has joined #osdev
rorx has joined #osdev
osmten has joined #osdev
innegatives has quit [Quit: WeeChat 3.8]
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
osmten has quit [Ping timeout: 245 seconds]
osmten has joined #osdev
osmten has quit [Client Quit]
heat has joined #osdev
heat_ has quit [Ping timeout: 256 seconds]
Jari-- has quit [Ping timeout: 248 seconds]
goliath has joined #osdev
osmten has joined #osdev
DynamiteDan has quit [Excess Flood]
DynamiteDan has joined #osdev
Jari-- has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
Jari-- has quit [Ping timeout: 268 seconds]
heat_ has quit [Read error: Connection reset by peer]
heat_ has joined #osdev
bliminse has quit [Quit: leaving]
gmacd has joined #osdev
gmacd has quit [Ping timeout: 248 seconds]
GeDaMo has joined #osdev
Terlisimo has quit [Quit: Connection reset by beer]
Terlisimo has joined #osdev
gmacd has joined #osdev
gmacd has quit [Ping timeout: 265 seconds]
<zid> Good news, I learned a new bit of regex syntax, now I can cheat at wordle better
slidercrank has joined #osdev
gmacd has joined #osdev
Burgundy has joined #osdev
nyah has joined #osdev
<Mutabah> negative character classes?
gmacd has quit [Ping timeout: 248 seconds]
<zid> ^(?=.*g.*)(?=.*e.*)(?=[^nstr]{5}$)[^g][^e]i[^e].$
<zid> forward lookaheads!
* FireFly looks ahead to the future
bauen1 has quit [Ping timeout: 268 seconds]
* kof123 rotates FireFly so they are looking at the past to see the future
<FireFly> :o
<FireFly> they do say to learn from the past..
gog has joined #osdev
<gog> hi
<zid> gog: Good news, I learned a new bit of regex syntax, now I can cheat at wordle better
<zid> bad news, I can't create ethanol anywhere near fast enough for purple science
<zid> tree farming tech sucks, and making it from natural gas needs lead as a catalyst and that's a byproduct of creating zinc, which I have 0 demand for
<GeDaMo> Which game is this?
<zid> factorio ofc
<GeDaMo> I downloaded the demo of Factorio the other day but I lost interest, it started to get annoying :P
<zid> THE FACTORY MUST GROW
<gog> ethanol??
<GeDaMo> Just having to decide where to place things makes me tired :|
<gog> are you plaing bob's mod or smth?
<zid> industrial revolution
<FireFly> factorio was like, one of those things that was intensely fun for a period and then dropped out of my mental cache, and now I can't really get back into it
<zid> I did B&A, and half of seablock already
<gog> i might get back into factorio
<zid> IR is funny it starts with steampunk
<gog> i usually do after i get bored with stuff
<zid> steam powered, clockwork buildings is T1
<zid> factorio and terraria are my two 'forever games'
<zid> I can just pick them up and play them whenever
<zid> otherwise I need them to fall out of cache for long enough that I don't remember them
danilogondolfo has joined #osdev
<GeDaMo> I was slightly obsessed with Slime Rancher for a bit :|
<gog> same
<gog> but it got boring very fastr
<gog> it was a cute game
<GeDaMo> I was playing Rush Mode for quite a while
<zid> I watched an edited down version of someone else play i t
slidercrank has quit [Ping timeout: 240 seconds]
<zid> GeDaMo: https://www.youtube.com/watch?v=y4TIDFJaKrU If you can't play it, watch dosh hate himself for playing it, it's almost just as good
<zid> but less effort
<bslsk05> ​'How Hard is it to Beat KRASTORIO 2?' by DoshDoshington (00:59:51)
<GeDaMo> "less effort" sounds like my jam! :P
dayimproper has joined #osdev
rorx has quit [Read error: Connection reset by peer]
<zid> also of note, today's squaredle, I've invented a new weapon, the javelaxe
slidercrank has joined #osdev
<GeDaMo> This video is not making me want to play Factorio :|
<GeDaMo> That's using the same E twice! :P
<zid> javelax* geez
rorx has joined #osdev
<zid> also my good friend lax dave is in here
hrberg has joined #osdev
<zid> express was super easy
hrberg has quit [Read error: Connection reset by peer]
elastic_dog has quit [Ping timeout: 250 seconds]
elastic_dog has joined #osdev
danilogondolfo has quit [Ping timeout: 250 seconds]
danilogondolfo has joined #osdev
dayimproper has quit [Ping timeout: 250 seconds]
bauen1 has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
heat_ has joined #osdev
elastic_dog has quit [Ping timeout: 240 seconds]
Matt|home has joined #osdev
elastic_dog has joined #osdev
dayimproper has joined #osdev
Left_Turn has joined #osdev
dayimproper has quit [Ping timeout: 240 seconds]
osmten has quit [Quit: Client closed]
dayimproper has joined #osdev
bliminse has joined #osdev
neilalexander has joined #osdev
Brnocris1 is now known as Brnocrist
dude12312414 has joined #osdev
<gog> hi
dayimproper has quit [Ping timeout: 250 seconds]
<heat_> grog
<gog> heat underscore
goliath has quit [Quit: SIGSEGV]
Brnocrist has quit [Ping timeout: 250 seconds]
<mjg> gog hk
[itchyjunk] has joined #osdev
gmacd has joined #osdev
<gog> hi
<mjg> :]
<mjg> that was a joke tho
<mjg> greg hk from linukkkz
<mjg> not a typo
<mjg> but i understand
gmacd has quit [Ping timeout: 248 seconds]
<gog> i don't know what linukkkz is
<gog> i'm not a nerd or a nazi
<sham1> liGNUx
<sham1> The G is silent
pharonix71 has quit [Remote host closed the connection]
<gog> ligmux
<gog> ligmux balls
pharonix71 has joined #osdev
<sham1> Gotem
Brnocrist has joined #osdev
<gog> owhahahahaohh
<heat_> mjg, it's greg kh u fuckin idiotttttttttttt
<gog> i want Linus to roast me
<gog> i bet he'd call me a hack and a loser and tell me to an hero
<sham1> omg it's kreg hong kong
<heat_> linus is old, he can't roast anyone
<mjg> i think that's ez to accomplish
<mjg> respond to one of his patches
<heat_> now, getting roasted by mjg, that's the shit
<mjg> citing chatgpt
<gog> mjg: roast me
<mjg> i don't do that
<gog> :(
<heat_> gog works for oracle
<gog> i said roast me, not commit libel against me
* sham1 seeing Oracle: https://i.imgflip.com/56kfpz.jpg
<heat_> have you noticed STREAMS does not have the letters g or o
<heat_> it's because the original title was STREAMS by gog
<mjg> streams is neither google nor oracle
<mjg> but it has s for SUN
<mjg> burp
<mjg> aight let's do it
<sham1> And M for Microsoft
* mjg is a standup comedian doing a gig now
<mjg> gog: what's your name
<heat_> the 'a' in ada means streAms
<gog> my name is ada
<heat_> the d in ada means deeznuts
<sham1> gotem
<mjg> ada loves lace
<gog> yes
<mjg> amirite
<gog> yes
<mjg> cue laughtrack
<mjg> ada was one shit programming language
<mjg> i see why they named it after you
<heat_> deeeeeeeeeeznuts
<mjg> cue more laughtrack
<gog> psure i was born after the language was named
<gog> i'm shit so they named me after it
<heat_> >laughtrack
<bslsk05> ​'I Reboot "Drake & Josh" by Adding a Laugh Track to Drake's Guilty Plea' by Frower House (00:05:04)
<gog> bazinkga
<mjg> have you seen the big bang theory without laughtrack?
<heat_> yes
<heat_> it's funnier
<gog> oh shit that's right didn't drake bell do some gross shit
<heat_> yes
<mjg> want some funny shit, watch a speech by a renowned CEO
<mjg> epitome of preaching the opposite of what you are known for
<gog> yi lon ma?
<heat_> gog, there's a comment on that video on how this may all be a result of dan schneider's actions and honestly i wouldn't be surprised
<gog> yeah that guy was a huge creep
<gog> i was never a fan of the live-action nickelodeon stuff anyway so it didn't really ruin my childhood
<heat_> if you go your entire childhood seeing a fucked up guy do fucked up shit, you may end up fucked up
<gog> yeah
<gog> deffo
<sham1> Honestly, if there was a version of BBT without the laugh track, I'd probably be interested in watching it. The laugh track just makes it stupid even though some of the jokes are admittedly funny even though it's just "haha, look at these nerds being nerds" most of the time
<gog> nerdface
slidercrank has quit [Ping timeout: 240 seconds]
<sham1> I also know enough Sheldon Cooper types to just get annoyed by this supposedly escapist media
<mjg> the biggest problem with bbt is that some people think watching it indicates being smart
<mjg> liek l-o-l but here we are
<sham1> Oh kinda like Richard and Mortimer
<gog> idk i don't know any self-proclaimed smart people that watch it
<gog> wait no
<gog> idk
<gog> i don't claim to be a smart person
<gog> i am, in fact, very not smart
<mrvn> "What are we going to do today?" "Take over the world!"
<gog> narf
<heat_> PICKLE RIIIIIIIIIICK
<heat_> funniest shit i've ever seen
<heat_> it's a scientist that turns himself into a PICKLE
* kof123 roasts gog, combure in acqua, lava in igne
<gog> high iq shit
heat_ is now known as heat
<sham1> I fear for my generation due to this
<heat> mjg, rdtsc or rdtscp? for tracing?
<heat> or lfence; rdtsc or what have you
jinn has joined #osdev
jinn has left #osdev [#osdev]
goliath has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<mjg> bro
<mjg> who cares
<heat> i don't know
<sham1> I cares
<bslsk05> ​old.reddit.com: JustBootThings
<sham1> And also tupac cares if no one else cares
<heat> mjg, btw GENERIC-DEBUG is the kernel with KASSERTs on right?
<heat> hmm, no, seems that GENERIC-NODEBUG is the one with them off?
<mjg> yes
<mjg> that's kernel-only tho
<mjg> malloc has a bunch of debug by default
<gog> mal alloc
<sham1> operator new
<gog> never allocate memory
<gog> the world has enough computer programs
<gog> do not write new ones
<heat> prgogram
<gog> do not write new gogs either
<heat> my fbsd build borken
<heat> oh well
<heat> i had a few cute syzkaller crashes I wanted to look at
<heat> but again Big FreeBSD is stopping me
<gog> bigbsd
xenos1984 has quit [Ping timeout: 250 seconds]
xenos1984 has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
wootehfoot has joined #osdev
<gog> bye
gog has quit [Quit: Konversation terminated!]
<mjg> heat: watcha doin mate
<heat> nothing
xenos1984 has quit [Ping timeout: 240 seconds]
gmacd has joined #osdev
k0valski188915 has joined #osdev
randm has quit [Remote host closed the connection]
randm has joined #osdev
xenos1984 has joined #osdev
gog has joined #osdev
<gog> hi
<Ermine> hi gog, may I pet you
<gog> yes
slidercrank has joined #osdev
* Ermine pets gog
bauen1 has quit [Ping timeout: 250 seconds]
gmacd has quit [Ping timeout: 248 seconds]
gmacd has joined #osdev
* gog prr
<Ermine> gog: what's the difference between AllocatePages and AllocatePool?
<gog> allocate pages allocates whole pages on page alignment
<gog> allocatepool is more like a heap
<gog> i think its alignment guarantee is 16 bytes iirc but i'd have to look at the spec
<Ermine> So AllocatePool is something like malloc, and firmware manages memory for me in this case?
<gog> sort of
foudfou has quit [Remote host closed the connection]
<Ermine> Thank you gog
foudfou has joined #osdev
<heat> yes
<heat> the firmware manages memory for you in both cases, but AllocatePool is like a heap
<gog> meowmory meownagement
<heat> sowwy, kewnew just cwashed :o
<sham1> no
<gog> oopsie woopsie we made a fucky wucky
<Ermine> There are two extreme points in how error messages look like and you're at one of them
* bnchs nibbles on the ram stick
<kof123> the other extreme is the duck hunt dog shows up when you didn't shoot anything for him note to self: add to BSOD ideas
<bslsk05> ​'oopsie woopsie!' by charoNN (00:00:10)
<heat> :( is the best error message
<heat> don't @ me microsoft did it first
<Ermine> Microsoft is about 0xINCOMPREHENSIBLE_HEX_CODE
<gog> i hate incomprehensible hex code
<gog> i want uwuspeak
* Ermine saw a github user which used uwuspeak in their issues
<gog> yes
<gog> more of this
gmacd has quit [Ping timeout: 265 seconds]
innegatives has joined #osdev
<Ermine> Also "An error has occured. Error code: I forgor <skull>"
<mrvn> forgor?
gmacd has joined #osdev
<Ermine> mrvn: yes, this is a meme
gmacd has quit [Ping timeout: 265 seconds]
gmacd has joined #osdev
wootehfoot has quit [Ping timeout: 250 seconds]
<gog> hi
<bnchs> hi gog
<gog> hi bnchs
<bnchs> i want pets
* gog petpetpetpetpet
* bnchs purrs
<gog> good girl
<bnchs> :D
<bnchs> thank you
<bnchs> you're also a good girl
<gog> eee
frkazoid333 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!]
gmacd has quit [Ping timeout: 268 seconds]
wootehfoot has joined #osdev
gmacd has joined #osdev
knusbaum has quit [Ping timeout: 250 seconds]
gmacd has quit [Ping timeout: 246 seconds]
knusbaum has joined #osdev
wootehfoot has quit [Quit: Leaving]
slidercrank has quit [Ping timeout: 250 seconds]
knusbaum has quit [Ping timeout: 250 seconds]
doppler has quit [Ping timeout: 240 seconds]
dude12312414 has joined #osdev
doppler has joined #osdev
dude12312414 has quit [Remote host closed the connection]
knusbaum has joined #osdev
zxrom has joined #osdev
* dzwdz pings heat for some unknown reason
<heat> hello dzwdz
<dzwdz> hi
<heat> ok so what is your system? unix I assume? your own libc?
<dzwdz> haha it'd be way simpler if it was an unix
<dzwdz> but it's *sort of* unixy
<dzwdz> and yup, my own libc
<dzwdz> so far i've decided that i'm going to port sltar (some random small tar implementation), sortix rw, gnu hello
<heat> so my recommendation really is to just power through with dash
<heat> because anything else is really boring and not interactive
<heat> GNU hello is trivial, just a printf. sortix rw I imagine is just lseek + write + read + exit
<dzwdz> the thing is, i'm non-unixy enough that i'll have to write some sort of emulation for the normal unix stuff
<dzwdz> files are weird. processes are weird. signals aren't.
<heat> define non-unixy here
<dzwdz> still heavily filesystem based, but in a different way. no PIDs (long story)
<heat> what's the problem with porting dash then?
<heat> you could also try busybox or toybox and start off really minimal and enable more and more shit
<dzwdz> i don't have none of the process handling code, a lot of standard unix file apis are missing, signals just don't exist atm
<dzwdz> hm
innegatives has quit [Quit: WeeChat 3.5]
<dzwdz> i thought both of those only had linux support?
<heat> you don't need signals for basic sh functionality, define process handling code
<heat> toybox supports freebsd and macOS, or at least tries to
<heat> busybox... I don't know
<heat> but "only supports linux" means little
<heat> most things only support linux
<heat> it's up to you to pretend you're linux or hack it up such that it supports your non-linux system
<dzwdz> well, i have fork(), i can wait for *a* child to die, and i can murder all children
<dzwdz> and i can send "an interrupt" to all children, whatever that means
<heat> that's perfect
<dzwdz> do you want to hear the idiotic way i'm exposing processes?
<heat> sure
<dzwdz> my /proc/ is recursive
dude12312414 has joined #osdev
<dzwdz> so a process can be e.g. at /proc/1/2/3/1
<dzwdz> except, depending on which process mounted /proc/, it could also be /proc/3/1 or /proc/42/5/1/2/3/1
gmacd has joined #osdev
<dzwdz> because when you mount /proc/ you only see yourself and your children
<heat> so you reinvented pid namespaces, but weirdly?
<dzwdz> indeed, i was just about to say that
<dzwdz> basically my goal with the kernel is to try and manage all resources/privileges through the filesystem and only through it
<dzwdz> to make messing around with sandboxing stuff easier
<heat> did you consider not doing that and just making it like a normal pid namespace?
Burgundy has quit [Ping timeout: 250 seconds]
<heat> it will be a PITA to refer to any process in your system
<heat> humanly and programmatically
<dzwdz> with this scheme, yes, but i think there are ways to keep the basic idea while making it more useable
<dzwdz> so, as with a normal linux pid namespace, i don't want to leak information about outside processes - so while i have internal kernel pids, i can't expose them to userland
<dzwdz> i can however expose encrypted pids
<heat> you don't leak anything in a pid namespace
<dzwdz> the amount of other processes on the system
<heat> you don't leak anything there
<dzwdz> if i try to run something that really wants to be pid 1, it can see that it isn't pid 1
<heat> if you make it so every child has its own pid namespace by default, it's always pid 1
<dzwdz> exactly
<heat> exactly what?
<heat> pid namespaces don't leak anything if you don't want to
<mcrod> i saw "if you make it so every child" and I thought I was going to see a political discussion, then I got scared
<heat> mcrod likes children
<mcrod> what.
<heat> children processes!
<heat> GOTTEM
<dzwdz> so, one of the original ideas for the os - which might be the worst one - was that you should be always able to run a program in a way where it can't tell if it's init or not
<dzwdz> no matter how low your privileges are
<mrvn> if you have privileges then you can tell
<dzwdz> because if a process can't tell if it has full privileges or no even if it tries
<heat> yes, and pid namespaces allow for that
<mrvn> dzwdz: if there is no difference between doing something with and without privilege then that isn't a privilege
<dzwdz> to finish that thought quickly - if a process can't tell if it has full privileges or none even if it tries, then you won't ever be unable to sandbox something because it needs a particular system feature
<heat> and you can still easily, uniquely refer to a pid inside your namespace, because all nesting pid namespaces map to yours
<dzwdz> mrvn: the difference is what resources you operate on
<dzwdz> the real init has access to the real hardware - the disk, network, etc
<dzwdz> the emulated init has access only to emulated hardware
<mrvn> so? if it can still e.g. query 8.8.8.8 that is no difference
<dzwdz> /if/
<dzwdz> that's more important in terms of disk access
<mrvn> if it can't query 8.8.8.8 with NET privilege then it can tell it has no NET privilege pretty conclusively.
<mrvn> aeh, without
<heat> anyway your pid isolation idea is super doable using a pid_namespaces-ish-solution
<dzwdz> but if it can't access /home/dzwdz/.ssh/id_ed25519, it doesn't know if that's because i just don't have that file, or because it's a vm
<heat> and that will be way easier to make work with normal software
<dzwdz> if i exposed encrypted pids that would also be easy to get to work with normal software
<heat> like dash does not care if its in a pid namespace, it Just Works. you give it a pid, that pid maps to its namespace, done
<dzwdz> like - i want to keep the weird thing where by mounting /proc/ you create a new pid namespace
<dzwdz> the current approach was the laziest one because it just uses the data structures i already had
<dzwdz> i could do the encrypted pids (which have the bonus of being consistent across different namespaces), i could also make each process keep a pid per each pid namespace it's in
<dzwdz> actually i'm stupid, i assumed they'd need to be in all previous pid namespaces but they don't
<dzwdz> just to clarify why i'm doing this all through the filesystem
<dzwdz> because i do realize that with every message i probably come off as more and more of an idiot
<dzwdz> i'm doing this to simplify the implementation of sandboxing tools as much as possible - i can currently do `whitelist /bin/httpd:ro /net/listen/0.0.0.0/tcp/80 /var/www -- httpd` to run a sandboxed httpd
<dzwdz> at least simplifying them is what i hope for
<dzwdz> i'm not explaining myself well, am i
danilogondolfo has quit [Remote host closed the connection]
gmacd has quit [Ping timeout: 240 seconds]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
Left_Turn has quit [Read error: Connection reset by peer]
DynamiteDan has quit [Ping timeout: 268 seconds]
<mcrod> help me understand this, people
<mcrod> an intern from a rather well known school in the US told us apparently the class instructor for C told them to avoid switch-case
<mcrod> i think i might cry some real tears.
<heat> but why?
<mcrod> allegedly, because it's harder to read and serves no practical application
<kof123> because you have to break else it will fall through ^
<kof123> not saying i agree, but ppl always say tha
<heat> lol
<kof123> *that
<mcrod> "harder to read" is insane
DynamiteDan has joined #osdev
DynamiteDan has quit [Excess Flood]
<mcrod> what the fuck are you writing, duff's device?
<kof123> some ppl dont like multiple returns...so if hell
DynamiteDan has joined #osdev
<heat> anyway "bad C advice in college" is the norm
<mcrod> the problem is
<kof123> ^ and the classic goto is bad...so dupliate your cleanup code
<mcrod> I've had to basically teach him C from scratch
<mcrod> understand that I'm not criticizing him in any way
<mcrod> but, fuck. what are they teaching
<heat> in mine they teach some really weird mix of shit advice and C89?
<mcrod> yeah he had no idea what stdint was, or designated initializers, or stdbool, or even that you can do // this is a comment
<mcrod> at least at work we have a copy of K&R and a really good book #c recommends
<heat> like in no way shape or form is "char, short int, unsigned, int, long int, unsigned long int" logical at all
<mrvn> switch needing break is one of the big mistakes in C
<mrvn> mcrod: the original K&R?
<heat> particularly in 2023 where if you use "unsigned varname;" you should be hanged
<bslsk05> ​'C Programming: A Modern Approach, 2nd Edition' - ''
<mrvn> heat: unsigned before int?
<mrvn> mcrod: bah, get the first edition. :)
<mcrod> which book
<mrvn> mcrod: the "int main(argc, argv) int argc; char **argv; { ... }" one or however that went.
<mcrod> i wouldn't curse him like that
<heat> main(argc, argv, envp) char **argv, **envp; {puts("poggers");}
<mcrod> either way I like this guy, at least he wants to learn and actively does the exercises and asks me questions
<mcrod> +1 to that guy
<heat> without includes and with a blanket statement like "puts is always faster than printf"
<heat> oh, bonus points if it writes to a string
<mcrod> modern compilers with optimization as far as I know translate printf("heat is actually not on fire or else he would be jerky\n"); to puts
<heat> correct
<mcrod> also, fun fact
<heat> but if my puts() is just printf("%s\n", str)...
<mcrod> our fancy corporate compiler doesn't like force inlining without optimizations turned on
<mcrod> whereas, in gcc/clang, you can do this
<heat> communist compilers >>
<moon-child> -fno-builtin or whatever
<gog> meow
<moon-child> meow
<gog> are we talking about c
<mcrod> we are
<mcrod> gog: may I pet you
<gog> yes
* mcrod pets gog
* gog prr
<mcrod> it was an astonishing finding, let me tell you.
<heat> gog gog gog gog
<gog> heat heat heat heat
<mcrod> we compile with optimizations turned off
<heat> what's your favourite linux kernel version
<mcrod> say 2.6
<gog> 4.20.69
<mcrod> that's when I used linux
<heat> that's not a thing gog
<heat> 4.20 was not a LTS release
innegatives has joined #osdev
<gog> ¯\_(ツ)_/¯
<mcrod> "we compile with optimizations turned off" for the record, this breaks the brain of every C++ programmer I talk to
<heat> C++ programmers are not real
<mcrod> C programmers ask at least "why would you do such a stupid thing", C++ programmers would go on about the greatness of zero-cost abstractions
<heat> there are no zero cost abstractions
<mcrod> i know that
<mcrod> they don't
<heat> chandler is the best
<mcrod> who
<heat> chandler, from friends
<mcrod> oh
<mcrod> i still say our firmware could be written with a limited subset of C++
<heat> youtube.com/watch?v=rHIkrotSwcc
<bslsk05> ​'CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”' by CppCon (00:59:52)
<heat> chandler from friends then moved into google's C++ toolchain team
<mcrod> is it a sin that I use the curiously recurring template pattern
<mcrod> because it works spookily fucking well
<heat> probably
<gog> it's templates all the way down
<heat> grog c++ programmer
<mcrod> I just do my best to avoid all of the super nutty fancy C++ abstractions that haven't been needed to make real programs since the dawn of time
<mcrod> not to say it's not helpful
<heat> grog make file go 40s compile time because templat
<mcrod> it's definitely nice to just say `std::vector` instead of rolling your own, but it also wouldn't be hard to roll your own either.
<mcrod> heat might remember me trying to implement std::function and I nearly died
<mcrod> he was there, in the end, to save me
<gog> i'm a c# programmer
* mcrod pet
<gog> remember
* gog prr
<heat> good times
<mrvn> mcrod: try it and see how hard it actually is
<mcrod> well don't fret, I think I have to do that again
<mcrod> mrvn no I want to
<mcrod> believe me, for all of the shit I complain about I want to do it
<mrvn> I think it's quite horrible that before C++23 there isn't any class for a buffer.
<heat> std::function is a dangerous abstraction for low level code
<mcrod> well, I do want to model some sort of play firmware on an eval board we have at work for C++
<mcrod> basically you could just say `component.do_this([]() { // this function gets called when that's done });` instead of what we're doing here
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<mrvn> mcrod: a lambda without closure is just a function pointer. std::function becomes complex when you have bound context.
<mcrod> right
<heat> you can do a function with a static buffer
<heat> that's *doable*
<mcrod> basically when I started that bullshit a few months ago, it was something like: `template<typename Function> class X { private: Function func_; };` since the class was going to call a function that was _never, ever_ going to change
<heat> still not as fast as raw function pointer, but doable
<mcrod> and my slight concern was whether or not the compiler would inline through the function pointer
<heat> if you're doing this for performance, you've lost already
<mcrod> basically "this class calls function func_, and it is always available, the function MUST and WILL exist"
goliath has quit [Quit: SIGSEGV]
<mcrod> why's that?
<mrvn> mcrod: only if the called outer function is inlined
<heat> indirect call, plus state you need to carry around, plus, in "standard" std::functions, heap allocation
<mcrod> I mean, std::sort in *theory* is faster because the comparator is inlined
<mrvn> mcrod: well, templates are always inlined. :)
<mcrod> right
<mcrod> that's my point :p
<mrvn> doesn't mean the comparator doesn't remain a function call
<heat> std::function is just a lot of hidden garbage that you *need* to care about in low level prog
<mcrod> sure, agreed
<mcrod> at least if we were to do this in an embedded context there indeed would be a static buffer or sorts
<heat> yeah, and then you'd need to copy that around :v
<mcrod> i'm sure it'd be fine :')
<heat> i should try it out in Onyx sometime. but I don't think it'll be that effective
<mcrod> i thought you had a std::function like thing in your shit
<heat> no
<heat> i gave you an alternative pattern
<mcrod> i don't remember
<heat> template <typename Callable> void for_every_thing(Callable c)
<mcrod> ah yes that
<mcrod> that I knew
<heat> then for_every_thing([](){});
<mcrod> but the problem was it broke down if Callable was a class member
<mcrod> which there was a solution, yes
<heat> it's stunning how bad C++'s lambda syntax is
<heat> [](){} ????
<mcrod> yeah I don't know what's up with the [&][=]
<mrvn> mcrod: lots of complicated binding
<gog> lambada
<gog> idk why they couldn't do arrow syntax
<mcrod> you wanna dance the lambada
<mrvn> gog: like how?
<gog> (param, param) => {statements}
<mrvn> gog: what's a binding and what's an argument?
<gog> idk i don' tknow how c++ lambdas work lol
<gog> please ignore me
<mrvn> they could have just bound anything that wasn't declared inside the function.
<mrvn> or like pythons nonlocal
innegatives has quit [Quit: WeeChat 3.8]
<mcrod> so
<mcrod> it seems disconnecting my PC causes EFI to lose track of where GRUB is...
<heat> gog
<heat> gogzinga
<gog> what
<heat> you just got gogzinga'd
<heat> *laugh track*
<gog> hahahahahha
<heat> everything is MUCH better with a laugh track
<mcrod> holy fuck
<mcrod> I can't get into the EFI shell
<mcrod> why is this happening to me
<heat> not being able to get into the EFI shell is the greatest gift you've ever been given
<mcrod> no it isn't
<mcrod> I want my goddamn grub partition
nyah has quit [Quit: leaving]
<mcrod> gog can I have some chili
<gog> i didn't make any
<mcrod> whyn ot
<mcrod> why not*
<heat> is this a southpark reference
<heat> i feel like it is
<mcrod> no.