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
leon has quit [Ping timeout: 260 seconds]
heat has quit [Ping timeout: 248 seconds]
karenw has joined #osdev
Matt|home has joined #osdev
leon has joined #osdev
benlyn has quit [Ping timeout: 265 seconds]
housemate has joined #osdev
housemate has quit [Remote host closed the connection]
housemate has joined #osdev
housemate has quit [Remote host closed the connection]
housemate has joined #osdev
housemate has quit [Remote host closed the connection]
housemate has joined #osdev
housemate has quit [Remote host closed the connection]
housemate has joined #osdev
housemate has quit [Ping timeout: 252 seconds]
Gooberpatrol_66 has quit [Quit: Konversation terminated!]
x64S has joined #osdev
x64S has quit [Max SendQ exceeded]
edr has quit [Quit: Leaving]
housemate has joined #osdev
housemate has quit [Ping timeout: 252 seconds]
solaare has joined #osdev
Gooberpatrol66 has joined #osdev
solaare has quit [Ping timeout: 248 seconds]
solaare has joined #osdev
remexre has joined #osdev
dostoyevsky2 has quit [Quit: leaving]
dostoyevsky2 has joined #osdev
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #osdev
cloudowind has quit [Ping timeout: 252 seconds]
vdamewood has quit [Quit: Life beckons]
Gooberpatrol66 has quit [Quit: Konversation terminated!]
cloudowind has joined #osdev
guideX has quit [Ping timeout: 272 seconds]
qubasa has joined #osdev
pabs3 is now known as Guest2867
Guest2867 has quit [Killed (copper.libera.chat (Nickname regained by services))]
pabs3 has joined #osdev
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #osdev
Arthuria has joined #osdev
guideX has joined #osdev
eluks has quit [Remote host closed the connection]
eluks has joined #osdev
Gooberpatrol66 has joined #osdev
mahk has joined #osdev
housemate has joined #osdev
x64S has joined #osdev
Arthuria has quit [Ping timeout: 260 seconds]
zenmov has joined #osdev
housemate has quit [Quit: Nothing to see here. I wasn't there. I take IRC seriously. https://files.catbox.moe/4e9k81.pdf]
hwpplayer1 has joined #osdev
GreaseMonkey has quit [*.net *.split]
the_oz has quit [*.net *.split]
puck has quit [*.net *.split]
frkzoid has quit [*.net *.split]
LjL has quit [*.net *.split]
bombuzal has quit [*.net *.split]
graphitemaster has quit [*.net *.split]
Ameisen has quit [*.net *.split]
chibill has quit [*.net *.split]
air has quit [*.net *.split]
m5zs7k has quit [*.net *.split]
khimaros has quit [*.net *.split]
jeaye has quit [*.net *.split]
Irvise has quit [*.net *.split]
nshp has quit [*.net *.split]
particleflux has quit [*.net *.split]
fluix has quit [*.net *.split]
eschaton has quit [*.net *.split]
m5zs7k_ has joined #osdev
GreaseMonkey has joined #osdev
the_oz has joined #osdev
bombuzal has joined #osdev
frkzoid has joined #osdev
LjL has joined #osdev
puck has joined #osdev
chibill has joined #osdev
graphitemaster has joined #osdev
Ameisen has joined #osdev
air has joined #osdev
khimaros has joined #osdev
Irvise has joined #osdev
nshp has joined #osdev
particleflux has joined #osdev
eschaton has joined #osdev
fluix has joined #osdev
jeaye has joined #osdev
hwpplayer1 has quit [Remote host closed the connection]
m5zs7k_ is now known as m5zs7k
npc has joined #osdev
GeDaMo has joined #osdev
remexre has quit [Ping timeout: 252 seconds]
remexre has joined #osdev
karenw has quit [Ping timeout: 248 seconds]
cloudowind has quit [Ping timeout: 248 seconds]
cloudowind has joined #osdev
strategictravele has joined #osdev
Left_Turn has joined #osdev
netbsduser has joined #osdev
x64S has quit [Remote host closed the connection]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
zenmov has quit [Ping timeout: 252 seconds]
zenmov has joined #osdev
Goodbye_Vincent1 has joined #osdev
bauen1 has quit [Ping timeout: 244 seconds]
bauen1 has joined #osdev
goliath has joined #osdev
edr has joined #osdev
Whooa21 has joined #osdev
KitsuWhooa has quit [Ping timeout: 252 seconds]
Whooa21 is now known as KitsuWhooa
jedesa has joined #osdev
MiningMarsh has quit [Quit: ZNC 1.9.1 - https://znc.in]
MiningMarsh has joined #osdev
heat has joined #osdev
jedesa has quit [Quit: jedesa]
jedesa has joined #osdev
Arthuria has joined #osdev
frkzoid has quit [Read error: Connection reset by peer]
frkazoid333 has joined #osdev
jedesa has quit [Quit: jedesa]
Arthuria has quit [Ping timeout: 276 seconds]
nortti has quit [Ping timeout: 252 seconds]
nortti has joined #osdev
Arsen has quit [Ping timeout: 252 seconds]
Arsen has joined #osdev
craigo has quit [Ping timeout: 252 seconds]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #osdev
npc has quit [Remote host closed the connection]
pabs3 has quit [Ping timeout: 244 seconds]
pabs3 has joined #osdev
strategictravele has quit [Ping timeout: 252 seconds]
bauen1 has quit [Ping timeout: 252 seconds]
bauen1 has joined #osdev
xenos1984 has quit [Ping timeout: 252 seconds]
sauce has quit []
xenos1984 has joined #osdev
sauce has joined #osdev
lte678 has quit [Ping timeout: 252 seconds]
guideX has quit [Killed (NickServ (GHOST command used by guideX__!matrixlink@user/guidex))]
guideX_ has joined #osdev
spare has joined #osdev
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
PapaFrog has quit [Remote host closed the connection]
PapaFrog has joined #osdev
mrpops2ko has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<heat> sqlite is so retro they amalgamate source code for optimization reasons
Gooberpatrol66 has quit [Quit: Konversation terminated!]
lynn_sh has joined #osdev
<Ermine> compilers are good at optimizing such code
<Ermine> skarnet concats source files when compiling s6 and execline as multicall binary
<Ermine> the result is surprisingly smol
lynn_sh has left #osdev [#osdev]
pabs3 has quit [Ping timeout: 265 seconds]
pabs3 has joined #osdev
mrpops2ko has joined #osdev
<heat> there's this 20 year old tech called LTO that already does this, but better
<Ermine> not sure if it will work on a bunch of binaries
<Ermine> worth trying though
<kof673> well, if you have sources, you can only compile in the libc you actually use, for example :D any such things needs full sources to be best :D
<netbsduser> sqlite is made by monks
<netbsduser> just like buckfast tonic wine
<netbsduser> i'm not exaggerating, this is their code: https://sqlite.org/codeofethics.html
<bslsk05> ​sqlite.org: Code Of Ethics
mpetch has joined #osdev
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
spare has quit [Remote host closed the connection]
<heat> sqlite is also made by people that have never written a line of code before, so the monks thing checks out
<heat> if( statbuf.st_size==0 && (pFile->fsFlags & SQLITE_FSFLAGS_IS_MSDOS)!=0 ){
<heat> do{ rc = osWrite(fd, "S", 1); }while( rc<0 && errno==EINTR );
<heat> if( rc!=1 ){
<heat> you'll be shocked but the whitespace *hasn't been mangled* by IRC
<zid`> They've got their whitespace inside out
<zid`> ( a<4 ) instead of (a < 4)
<geist> heat: that looks like pretty standard retro C code written in the 80s
<nikolar> Not sure lto does better job at optimizing compared to amalgamates builds
<geist> i've seen a lot of old 80s/90s C code, and the vast majority are like that
<nikolar> I'd expect it to be almost exactly the same
<zid`> yea lto's main strength is the same as cat's
<geist> i always point folks at SIMH, which has one of the weirdest hardest to read styles ever
<nikolar> Heh
<bslsk05> ​github.com: simh/PDP11/pdp11_cpu.c at master · simh/simh · GitHub
<geist> well it's actually fairly consistently formatted, the style is just fuckin weird
<zid`> this looks really normal
<zid`> other than the }
<nikolar> Oh indented }
<nikolar> Yuck
<nikolar> But yeah seems pretty tame otherwise
<geist> wel indented } and the other hard thing to read (that's not obvious on the web page) function bodies are not indented one
<zid`> yea weird
<geist> that makes it incredibly hard to tell where functions start/stop
<geist> but i guess gets you effectively a lost tab back, which if you're on some vt100 terminal with 8 space tabs... i guess that's a thing
<nikolar> Heh
<heat> geist, kernel normal form was and is pretty alright
<nikolar> For the most part
<zid`> nikolar is it day 13 yet
<nikolar> I don't get the return (whatever)
<geist> separate line { } really drives me nuts but i see it as being pretty valid
<zid`> I kinda wanna do an aoc again already
<geist> idented } is weird though
<heat> old win nt style is also okay despite the culture clash between unix and the DEC man
<nikolar> zid`: no
<zid`> the only horrible style that's actually in common usage is gnu's lol
<geist> if() vs if () i used to do myself but switched in the 2000s
<nikolar> I used to do if() too
<geist> ie, make statements like if and for have a space before the ()
<geist> and yeah years ago i used to always return ()
<zid`> I still do if() and I'd like to change but.. I can't be bothered
<zid`> *that* one is weird
<zid`> That's weirder than the non-indented function bodies :P
<heat> i'm slowly over time stanning same line {
<geist> yeah i stopped, it was just picked it up somewhere. i think the idea was having 'naked' looking expressions like that with return looked funny to me
<heat> looks just a little more compact whilst being legible
<zid`> I like that it's a little bit less tall, but I dislike more, the unevenness
<geist> since i dont think there's anything else like that
<nikolar> heat took you a while
<geist> without a = on the left side at least
<zid`> geist: sizeof x or sizeof(x) or sizeof (x) though
<heat> sizeof(x)
<zid`> *gags*
<nikolar> What's the reasoning with return (x)
<heat> not even a question
<geist> true, but i also never ever write sizeof without ()
<heat> sizeof x is for musl programmers
<nikolar> I do that
<nikolar> And I don't musl
<geist> in fact until you just mentioned it i totally forgot you could!
<zid`> nikolar: We should form a support club
<nikolar> What for
<zid`> People terrorised by other people who write sizeof(x)
<nikolar> Lol
<nikolar> Good idea
<geist> heh not sure i've seen much standalone sizeof in any code base i've looked at recently
<geist> you are in for some ptsd
<nikolar> Kek
<heat> i've seen it in musl and.... nothing else
<nikolar> I mostly read the code I've written so it's fine :P
<zid`> geist: to be fair, 99% of the time, it isn't valid to remove them
<nikolar> Yeah
<zid`> So you need to overcount them by 100;1
<zid`> the last time I wrote it was.. 3 days ago :P
<geist> ternary operator. fight.
<zid`> day8b.c: for(i = 0; i < sizeof alphabet - 1; i++)
<heat> ternary operator is sometimes based
<zid`> only for replacing if(a) b = c; else b = d;
<heat> ternary with omitted operands is MEGA BASED
<zid`> as in, boolean test on a value
<zid`> no embedding fucking commas (I bet heat does that)
<geist> there was some based thing i saw i think sortie doing at some point with regards to exiting a function and conditionally setting errono
<geist> i think it was ternary based + comma operator
<zid`> see
<heat> no, sortie just does the comma operator, no ternary i think
<geist> i thought it was something like
<heat> like return errno = ENOMEM, NULL;
<nikolar> Ternary based
<nikolar> I wish a ?: b was standard
<geist> `return (err < 0 ? errno = err :,err)
<geist> or something like that
<nikolar> Ah neat
<zid`> nikolar: like, as a conditional-overwrite-or-don't-touch?
<geist> that's almost certainly broken, but was somethinglike that
<nikolar> zid`: yeah
<nikolar> So a ?: b is a ? a : b
<zid`> eh I don't want it if that's what it does semantically
<nikolar> Neat for null checks and such
<zid`> I need it to be a ? : b;
<zid`> with nothing on the left side
<geist> i think the (a ?: b) has the property of only evulating it once?
<nikolar> What would that do
<zid`> see geist
<nikolar> Yeah, it's only evaluated once
<geist> so in some C++ stuff that's pretty powerful when those types can be complex
<zid`> like, I don't want it to turn into a = a; in one case
<geist> SPACESHIP OPERATOR
<nikolar> I guess more accurate would be tmp = a; tmp ? tmp : b
<zid`> goestoward operator
<heat> my kernel has around 400 ternary expressions
<nikolar> Nice
<zid`> how many goestoward heat
<heat> 30 ?:
<geist> nikolar: right but then the trouble there is the tmp copy could hit a copy constructor, etc and do extra work
<nikolar> I don't c++ :)
<geist> so it's bettter if the RHS of the eval does directly to the return, or something like that
<nikolar> I am talking exclusively about c here
<zid`> I wrote a lexer so I can tell you precisely how many ?: my code has without accidentally including "Hello? Fuck you :)"
<geist> one day for a brief moment i had a flash of insight and fully grokked RHS vs LHS and now move and && worked and whatnot
<nikolar> Kek
<geist> the skies opened and angels tooted their trumpets
<geist> i was walking across the google campus and i saw all the youngsters on their colorful bikes
<geist> all was well
<zid`> nikolar: I wanted it for mmmmmio
<zid`> so that it didn't do MMIO_A = MMIO_A; in the false case
<geist> also i had a free latte
<nikolar> Or, you can just choose a language where you don't need to solve a riddle for every operator you use :P
<geist> but that wasin the before times.
<heat> yeah, before the inflation
<kof673> that's when various characters tend get stoned :D ^^^^^^^^^^^^^
<kof673> *tend to get stoned
<kof673> the stoney kind of stoned lol
<geist> before the pandemic made it all dissapear and never return
<heat> nikolar, which language would that be
<nikolar> C
<geist> now my lattes are less frothed
<nikolar> Even rust
<heat> is it?
<geist> boo how do i work with this?
<heat> fuckin
<heat> unsigned short a = 0; __typeof__(a + 0)
<geist> well, i think that's mostly against the employee handbook
<geist> oh side note i wrote something using C11 Generics the other day
<heat> WHAT
<geist> it was pretty good. sadly C++ does not understand it, so you can't really use it in a mixed environment header
<heat> does google know you're writing C at work?
<geist> i wanted to write basically a type aware macro like thing
<geist> oh no this was for LK
<heat> does google know you're writing C outside of work?
<geist> i have tenure
<nikolar> heat: int, next
<heat> i think it's against the employee handbook
<geist> well, i was really saying the employee handbook was against fuckin at work
<geist> *probably*
<heat> fuckin is less serious than writing C, to google
<geist> more home grown googlers!
<nikolar> Kek
<geist> heat: been kinda fun, been a whiel since i wrote SMP bootstrap shit for x86-32 and -64
<geist> so been doing it yet again on LK without consulting anything else
<geist> kinda nice to see how much GDT and whatnot shit you remember off the top of your head
<heat> oh that's nice
<geist> also i think it's time to switch to per-cpu GDTs instead of one. one fatal flaw with having a single GDT with per cpu TSS/etc entries, is on x86-32 you want to probably have a single gs *value* that you just blat into the cpu on exception entry
<geist> and that means having a per cpu gdt with a different segment descriptor in that slot
<geist> *or* a LDT i guess
<heat> here's a really fun fact: clang++ understands _Generic
<geist> on x86-64 this doesn't matter beause the whole gs: nonsense is pointed to by setting MSRs
<heat> yay swapgs
<geist> yeeep. swapgs :(
<heat> the best instruction ever
<heat> WOAH we have swapgs hater in the room
<geist> yeah that was a huge mistake, tons of bugs as a result of that getting out of whack
<heat> if you want extra fun you should parse and load microcode
<geist> they should have designed it as `setgs 0` `setgs 1`
<heat> it is Not That Hard
<geist> protip if you design any hardware never ever implement things as toggling without a way to read the current state
<geist> that a sequence bug waiting to happen
<nikolar> Oh yeah that's horrible
<zid`> nikolar: What about ?: for tokens?
<nikolar> ?
<zid`> thinking of AoC day7 where you had to either add or multiply
<zid`> based on a flag
<zid`> a = a (flag #? + : *) 4;
<zid`> idk how you'd terminate it though
<nikolar> Oh yuck
<nikolar> No
<zid`> ikr it's insane, I love it
<zid`> I bet rust can do it
<nikolar> You'd probably use that like twice in your whole life too
<zid`> Sounds like a job for C++ then
<nikolar> Yes
edr has quit [Read error: Connection reset by peer]
mpetch has quit [Quit: Client closed]
Celelibi has quit [Remote host closed the connection]
graphitemaster has quit [Ping timeout: 260 seconds]
_ngn has quit [Ping timeout: 264 seconds]
graphitemaster has joined #osdev
Celelibi has joined #osdev
mpetch has joined #osdev
x64S has joined #osdev
sortie has quit [Ping timeout: 260 seconds]
leon has quit [Ping timeout: 244 seconds]
mpetch has quit [Quit: Client closed]