<Cindy>
your printf is average, can't print, but does print, when it does, it performs averagely
<zid>
Did you write it like this as a joke?
<heat>
write it like what?
<zid>
Oh.
<Cindy>
i had an AI write my review, sorry for that
<heat>
No problem at all! It's interesting that you chose to use an AI to write your review. AI technology has come a long way, and it's fascinating to see how it can assist us in various tasks, including writing. While AI-generated content can sometimes lack the human touch and personal experience, it can still provide valuable insights and perspectives.
<heat>
If you feel like sharing your own thoughts and opinions about the subject, I'd be happy to hear them. Remember, a review is ultimately about your own experience and perspective, so feel free to add any additional details or impressions you'd like to share.
<zid>
after all that moaning, this looks very similar to mine, re the vfprintf part, I just gobble all the non % really early
<zid>
instead of that weird perc thing
<zid>
I have a backwards goto instead of a continue and a flag
<zid>
to tell it to do special shit the next iteration
<heat>
ugh i keep seeing weird edge cases
<heat>
also mildly annoying that i need 64 bit div for long long :/
<heat>
and i dont like with libgcc because that's for smelly losers
<zid>
heat: It'd be neat if you wrote a test rig btw
<zid>
I'd probably flesh my printf out if I had one
<zid>
just int main(void) { /* 300 calls to print */ }
* mcrod
stares at the goto
<zid>
I can link it against glibc and then diff the output vs mine
MiningMarsh has quit [Ping timeout: 264 seconds]
<heat>
there's a test rig already in zircon, i'll probably make it use google test and that's enough for me
<sham1>
Why one would use string_view with printf instead of for example fmt, I have no jdea
awita has joined #osdev
dh` has quit [Read error: Connection reset by peer]
gog` has quit [Ping timeout: 260 seconds]
GeDaMo has joined #osdev
gog has joined #osdev
mahk has quit [Ping timeout: 245 seconds]
mahk has joined #osdev
lainon has joined #osdev
<gog>
hi
Left_Turn has joined #osdev
<vdamewood>
hi
* vdamewood
gives gog a fishy
xenos1984 has quit [Read error: Connection reset by peer]
<GeDaMo>
If wishes were fishes, we'd all cast nets
* sham1
casts the internet
lainon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
* gog
chomp fishy
<mjg>
osdev chatlog nfts for sale
<mjg>
you can join an exclusive club of people rugpulled by me
<mjg>
who is in
<gog>
me me me
<mjg>
stay tuned. i'm really excited about this project
<mjg>
#notfinancialadvice
<GeDaMo>
What kind of rug? :|
<mjg>
have you seen a russian place with a rug on the wall?
<mjg>
that kind
<mjg>
colorful' n shit
xenos1984 has joined #osdev
lainon has joined #osdev
lainon has quit [Client Quit]
<Ermine>
That's considered tasteless
lg_ is now known as lg
* mjg
slaws like a gopnik
<mjg>
squats
<Ermine>
Make sure your heels are lowered. Otherwise you're dishonored one
<gog>
slaw
<Ermine>
What should I cook today
<Ermine>
I thought of paella but idk how to pick good ingredients. And that's going to be expensive
Left_Turn has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
gog` has joined #osdev
<gog>
gog` wtf are you doing
gog` has quit [Client Quit]
Left_Turn has quit [Remote host closed the connection]
Left_Turn has joined #osdev
<mcrod>
hi
<gog>
hi
<mcrod>
gog may i pet you
<gog>
yes
* mcrod
pets gog
* gog
prr
Left_Turn has quit [Ping timeout: 240 seconds]
Left_Turn has joined #osdev
Left_Turn has quit [Ping timeout: 260 seconds]
Left_Turn has joined #osdev
dutch has quit [Quit: WeeChat 4.0.1]
Left_Turn has quit [Ping timeout: 240 seconds]
mahk has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
dutch has joined #osdev
mahk has joined #osdev
Left_Turn has quit [Ping timeout: 240 seconds]
<LittleFox>
sometimes this channel is wild - one day you discuss with professional OS developers and another day you see pets being exchanged - very nice :3
<jimbzy>
A lot of days you see both.
<LittleFox>
maybe should be idling less then ^^
<gog>
LittleFox: may i pet you
Left_Turn has joined #osdev
<LittleFox>
sure, but beware the scales - they might be sharp
<LittleFox>
hm, my name isn't up-to-date here
LittleFox is now known as DragonFox
* gog
pet DragonFox
<DragonFox>
*purrrr*
<DragonFox>
*offers headpats in return*
* gog
prr
<mjg>
so there was a study about chatgpt's effectiveness in investing
<gog>
how effective was it
Left_Turn has quit [Remote host closed the connection]
<mjg>
and it found it outperforms other models by 500% or some shit
<mjg>
right?
<mjg>
wrong
Left_Turn has joined #osdev
<mjg>
the author pulled in 4 different LLMs, including 3 different versions of chatgpt
<mjg>
and asked them to evaluate a headline about a company, whether it is positive
<mjg>
so... chatgpt 3.5 won over 4
<mjg>
basically lol strat which got lucky
<mjg>
but now this is making rounds with a claim that chatgpt beats traders
<gog>
ah yes science
<gog>
where you test a hypothesis, only the hypothesis, and have no experimental control
<mjg>
on top of that the author inflates the win by not denoting it came from gazillion small transactions which would kill majority of it due to fees
<mjg>
this is the same as an octopus or osme other animal making better picks
<gog>
i'd trust the octopus more than llms
<mjg>
octobus never made up a scientific paper, i can tell you that much
<mjg>
[octo*b*us is a very nice typo if i may say]
<gog>
"scientific" paper
<gog>
octobussy
<zid>
they made a bond film about that
nur has joined #osdev
[itchyjunk] has joined #osdev
<mcrod>
i am very sleepy
<gog>
eepy
* gog
tuck in mcrod with a plushie
* mcrod
sleep
<zid>
Professionally tucked by a trans girl, how lucky
<mcrod>
at least someone tucks me in
<gog>
zid: that's an underhanded way to call him a dick
<gog>
smh
<zid>
does tucking work if you have a.. large spread?
<zid>
thorn still doesn't look like a real letter to me
<zid>
eth is fine
<sham1>
I dislike that thoth
<sham1>
That's not even a good spelling
<zid>
do icelanders really pronounce it Þöð? That's cray
<mcrod>
guys
<mcrod>
i'm getting a cheesesteak
<gog>
idk
<gog>
omg cheesesteak
<zid>
they had better not
<GeDaMo>
Θώθ
<gog>
UwU
<GeDaMo>
Why not Zoidberg? :|
<sham1>
3:
<gog>
whoop whop whop whop whop
wns has quit [Read error: Connection reset by peer]
<gog>
nooooo the table i needed isn't all entity frameworked
<gog>
noooooooooooooooooo
<sham1>
Sad
* gog
jumps out the window
netbsduser has quit [Remote host closed the connection]
<GeDaMo>
Autodefenestration :|
<zid>
always tragic to see
* gog
returns through the same window
<gog>
autorefenestration
goliath has joined #osdev
<zid>
I think that's when you reinstall your own windows after the fs corrupts
<gog>
that's a terrible idea
<gog>
just install freebsd
<gog>
freebsd is very good to use
<gog>
oh heat isn't here
<zid>
yea usually that summons him
<sham1>
gog: I have one better
<sham1>
USE OPENBSD
<gog>
i'm not even going to joke about that sorry
<zid>
sham1: how could you?
<gog>
L + ratio + you fell off + touch grass
<zid>
Even as a joke, geez
<zid>
Pretty sure a lot of countries have laws against that now, they call it cyberbulling, you can get banned for saying stuff like KYS in chat, and imo what you just said crosses so many more lines.
<kazinsal>
the ghost of theo de raadt curses you and your builds forevermore
<zid>
My builds are already cursed
tomith has quit [Quit: tomith]
<sham1>
Not to worry. Theo will protect me. Somehow
<zid>
I wrote the makefiles and the code
<gog>
makefiles? more like BREAKfiles amirite
<gog>
sksksksksks
<sham1>
Needs more ninjas
<zid>
The meson ninjas attack at dawn, alert the cmake for the ants.
<zid>
that's my sleep cell activiation node
<zid>
code*
<zid>
sleeper*
<zid>
That's*
<sham1>
Let's hope there is not too much maven. I mean mayhem
<kazinsal>
first day back at work after three weeks off: 2486 unread emails
<kazinsal>
yaaaaay
<sham1>
rip
<GeDaMo>
Select all, delete! :P
<kazinsal>
deeply considering it
<gog>
oof
<zid>
You weren't at work, those emails aren't for you
<kazinsal>
I didn't look at my work stuff at all for any of the time I was off so it's fun reading the fires that went on and either burnt out or got drenched in my absence
<zid>
canadians are americans
<zid>
as much as they refuse to admit it
<kazinsal>
eat shit eh
<zid>
The alternative is that they're french
<zid>
so they have it bad both ways tbh
<kazinsal>
manger de merde, tabarnak
<gog>
lel
<gog>
i've heard my wife use the word "tabarnak" sometimes
<zid>
<bizzare hockey noises>
<gog>
she lived in quebec for like a year
<gog>
and picked up a lot of french
<FireFly>
the heck is tabarnak :p
<kazinsal>
it's a quebecois french curse word
<zid>
FireFly: <bizzare hockey noises>
<kazinsal>
literally translates to "tabarnacle"
<FireFly>
I.. see
<kazinsal>
functionally translates to ANGRY FRENCH SWEARING
<FireFly>
so a bit like when they call you a chatte that's not actually suggesting you're a cute kitty
<kazinsal>
quebec french swearing is a complicated mess that's basically about stringing together catholic sacraments for metaphorical verbal abuse
<kazinsal>
thankfully, we have them mostly contained east of ontario
<bl4ckb0ne>
kazinsal: its "mangeux de marde"
<zid>
And to pronounce it, you ignore everything past 3/4 in each word
dh` has joined #osdev
<bl4ckb0ne>
in this case you can do "d'marde" instead of using the 2 words
<zid>
mang d mard
<zid>
see, works fine
<bl4ckb0ne>
doesnt
xvmt has quit [Ping timeout: 250 seconds]
slidercrank has joined #osdev
<FireFly>
oh that's just "eat shit"
<FireFly>
amazing, I can read things in french
<FireFly>
(sometimes)
<zid>
tu mange le piscine
<zid>
juh muh apple zid
<bl4ckb0ne>
FireFly: its "shit eater" but same vibe
<zid>
eats of shit
<zid>
mon chat est dans le poubelle
<bl4ckb0ne>
j'ai une tour eiffel dans mon pantalon
<FireFly>
je mange des crème glacée
<FireFly>
er I guess that should be a le or whatever
<FireFly>
idk I'm not french
<sham1>
This chat is not very Bauhaus
<FireFly>
was
lainon has joined #osdev
<kazinsal>
mon aéroglisseur est plein d'anguilles
<bl4ckb0ne>
FireFly: mixed plural and singular here
<bl4ckb0ne>
kazinsal: kek
<zid>
les
<FireFly>
bl4ckb0ne: yeah I'm not even going to attempt getting grammar right :D
<FireFly>
my french exclusively comes from doing duolingo for like a year
<zid>
french has the adjectives in the wrong order
<sham1>
Could even call the chat pessimal
<zid>
disgraceful language
<bl4ckb0ne>
FireFly: either "je mange une crème glacée" or "je mange des crèmes glacées"
* FireFly
caresser le chat
<FireFly>
bl4ckb0ne: ahh
<FireFly>
so my brain wasn't entirely kaputt at least
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #osdev
ih8win8 has joined #osdev
* mcrod
slaps zid
<mcrod>
maybe you'll know
<mcrod>
how hard is gameboy APU sound generation
<zid>
not very
<zid>
4 basic channels with like 2 regs eac
<zid>
and the maximum the cpu can fiddle with them is 1MHz
<mcrod>
is it really as simple as (I have no idea, I have no spec I'm looking at right now, just a general question) "ok, channel 2 is to make square waves, so make a square wave when enabled with frequency x for t time"
<zid>
so even without any technical knowledge of how sound works so that you can cut corners, you could just sample at 1MHz then ask a library to downsample :P
<ih8win8>
What is a USB PHY? I hear this term PHY thrown around, and I'm not entirely sure what it is.
<zid>
physical
<ih8win8>
So, basically like the physical layer in OSI networking terminology.
<zid>
mcrod: sound enable reg for all off / ch1 off / ch2 off / ch3 off / ch4 off, sound panning (2 bits * 4) for which speaker each channel goes to
<mcrod>
hm, i see
<zid>
sweep channel has 'sweep pace', 'add/sub' and 'slope'
<zid>
then 2nd reg is wave duty and length
<mcrod>
so as far as I know, oversimplfying it, the APU is basically just a shit ton of counters, right?
<zid>
3rd reg is volume, volume direction, volume change pace
<zid>
yes
<zid>
You can literally model it all perfectly accurately at 1MHz just ticking a very basic state machine
<zid>
The only issue re accurate sound emulation is that if you try to pretend it's a 44kHz system, the cpu could have changed the registers many many times per sample
<zid>
so if you want it to be quick *and* accurate, you need to implement a sort of time warping
<mcrod>
yeah, the sync stuff scares me
<zid>
But if you just leave it at 1MHz, then the cycles are the same
<zid>
you just downsample at the end
<mcrod>
to the best of my knowledge, most emulators will run until the sound buffer is full, dump the sound buffer to the sound device, repeat
<zid>
yes, that's how you sync to wall time
<mcrod>
but what if sound is disabled?
<zid>
because 10ms of 44kHz audio is 10ms of walltime
<mcrod>
I guess it's just a matter of taking a different path then
<zid>
no matter what
<zid>
mine vsyncs, close enough, cus I don't have audio
heat has joined #osdev
<zid>
I had a nice 'bug' before I had a nice LCD implementation that effectively the emulator turned into a while(1) if the display was disabled :P
<heat>
hello, its me, the creator of onyx, the world's least innovative operating system
<zid>
Did you innovate a %V into your printf yet
<heat>
no
<heat>
printing std::string_view is for losers
<heat>
and as i said, i don't innovate
<zid>
Isn't %V just %*s anyway
<heat>
yes, but %*s sucks
<zid>
idk if evaluating a class or whatever in C++ can return two params though
<heat>
it doesn't evaluate anything
<heat>
their solution is a huge hack but just works
<zid>
nice
<zid>
what do you get if you evaluate a class?
<heat>
given std::string_view is basically {ptr, len}, they send thru varargs
<zid>
just type class blah?
<zid>
with value "stop trying to take values"
Turn_Left has joined #osdev
<heat>
what is "evaluate"?
<zid>
value context
<heat>
i don't see what you mean
<zid>
int a = 4; a = 7; that second line is lvalue context, so it doesn't mean 4 = 7
<heat>
ah ok
<zid>
but b = a; means b = 4; cus a was evaluated, the rhs is an evaluation
<zid>
'evaluation' meaning 'to get the value of'
<heat>
it will just copy
<zid>
okay but what type and what value, and can I interact with that
<heat>
given std::string_view a; printf("%V", a); makes a copy of a and sends it down the varargs drain
<heat>
"a" will be of type std::string_view& (aka a reference)
<zid>
okay so pointer (reference) to type
<zid>
class blah
<zid>
same as strings
<zid>
or functions
<zid>
****************f(); :D
<heat>
i'm not sure if it gets a std::string_view&
<heat>
might get a brand new copy in the varargs thing for all I know, i've never checked that
Left_Turn has quit [Ping timeout: 260 seconds]
<heat>
that /may/ be the hack IIRC
<heat>
that you get a "std::string_view*" from all that garbage
<zid>
I assumed they could just overload the evaluate
<zid>
so 'sv' evaluates to the string it wraps
<heat>
ok, it gets a copy
<zid>
you can overload conversion to blah I think
<zid>
so if you overloaded 'whatever type it ends up as' conversion, that could work
<heat>
there's no conversion happening
<zid>
like if(sv) you can overload cast to bool, like 'cin' does
<zid>
idk how you convince it to convert it to char * though
<heat>
you cannot possibly convert it to char*
<zid>
only because there's no default operator for that, you absolutely *could*
<heat>
string_views are not zero terminated
<zid>
same way you can convert a class iostream blah to 'false'
<bslsk05>
fuchsia.googlesource.com: zircon/kernel/lib/libc/fprintf.cc - fuchsia - Git at Google
<heat>
see this? they just get a copy of the object on the other end of the vararg garbage
<zid>
You'd actually want it to evaluate to a *tuple* where you did case 'V': len = va_arg(fmt, size_t); str = va_arg(fmt, char *); but I imagine that's even less possible
<zid>
yea I'm not talking about what they actually do
<zid>
I was wondering if you could make it evaluate to something arbitrary
<zid>
(so that I could maek it work via the regular C abi)
<zid>
but C++ doesn't really do tuples any more than C does really I don't think?
<sham1>
std::tuple
* sham1
runs
<heat>
a C++ tuple is just a fucked up templated struct
<zid>
yea I don't consider that a language feature
<sham1>
Yes, with a weird way of accessing it
<zid>
that's a stdlib implementation of a feature
<zid>
like hash tables
<zid>
C++ has no hash table /operator/
<kazinsal>
typedef struct { uintptr_t a, b; } tuple_t;
<sham1>
Achually
<sham1>
std::tuple is STL
<zid>
and there's the "any moreso than C"
<zid>
yes, STL = standard library
<sham1>
No it isn't
<sham1>
They're two different things
<heat>
aktshually, STL is not a thing
<zid>
standard (template) library
<zid>
part of the standard () library
<heat>
it's the C++ standard library
<heat>
the STL is an old term
<sham1>
Apply the as-if rule
<zid>
Like how stdio is part of the C standard library, they have some templates
<zid>
that they named stl
<sham1>
As if STL is still a relevant name
<mcrod>
i've been doing some STL rewrite stuff on my own
<mcrod>
i actually find that it helps me understand the language better
<heat>
haven't learned your lesson yet?
<mcrod>
it's still a crapshoot
<zid>
so yea, anyway, C++ doesn't support tuple types, like say, python seems to
<mcrod>
but at least I know more
Left_Turn has joined #osdev
<mcrod>
heat: no
<heat>
zid: anyway, yes, you could have some struct S {char *str; size_t len}; and then pass it through C varargs
<zid>
where I could do f(g(x)); where g returns a tuple type and f() takes two params
<zid>
both of which get filled
<zid>
heat: Obviously
<heat>
then std::string_view could have an operator S() that converts the string view to S (just like operator bool converts to bool)
<zid>
but someone has to allocate that and fuck that
<geist>
yeah there's definitely folks on the team that are of the opinion that const char * is bad. etc
Turn_Left has quit [Ping timeout: 245 seconds]
<geist>
newer code it's hard to pass one around without someone telling you to use a string view
<zid>
Yea, it's very easy to have OPINIONS in a C++ codebase, with how many options you have
<sham1>
Why do they think const char * is bad
<mcrod>
i don't understand what's the greatness with std::string_view
<heat>
also yeah it was roland i win
<zid>
C's like "You're doing it this way, glhf"
<mcrod>
seems like it's mostly crap
<heat>
dude
<geist>
iirc the string view can have a length and you can use it to point to a substring, etc etc
<zid>
it's something you occasionally implement
<zid>
in about 2-3 mins
<zid>
when you're dealing with strings
<geist>
right, which then folks will instantly say 'well then use string view and you dont have to reimplemt it'
<heat>
imagine a std::string? but without actual allocation behind it, points at anything, and does all std::string operations
<geist>
which has some truth
<zid>
so it saves you those couple of minutes hwen you're using C++ like python
<sham1>
std::string_view can quite literally just be struct string_view { char *m_begin; char *m_end; } // modulo constness
<heat>
including things like /*std::string_view a;*/ std::string s{a};
<heat>
sham1, bruh
<geist>
right and then you can pass it into a bunch of things. it's quite powerful
<heat>
struct string_view {char *_M_begin; char *_M_end;} you mean
<geist>
it's not what it's implemented as, it's wha tyou can do with it in standard apis, etc
<heat>
also needs to be template <typename _Type> struct basic_string_view
<sham1>
I don't break the C standard by doing _Capital
<geist>
the implementation is of course not complicated, which is good, because if it were complicated the overhead would be too high
<heat>
you're breaking the C++ standard by not doing it
<sham1>
Good. C99 foreva
<mcrod>
hm
<heat>
hm
<mcrod>
sham1: how old are you
<sham1>
24
<mcrod>
it doesn't make any difference at all, this is for my own curiosity
<mcrod>
ok 24
* mcrod
notes
<heat>
GEN Z GANG!
<sham1>
yes
SGautam has quit [Quit: Connection closed for inactivity]
<mcrod>
you are one of the few people in that age group I've come across in recent times who say C99 forever or similar
<geist>
anyway i need to get more used to string views, honestly. it's one i really cant argue much about
<heat>
send me your tiktok
<mcrod>
the rest are in their 40s or 50s
<heat>
yes, i say C89 forever!
<mcrod>
no
<geist>
though of course one of the downsides is printf (vs iostream)
<mcrod>
i forbid it
<heat>
oh right, I say K&R forever
<geist>
but we solved that with the %V thing, so back full circle
<sham1>
geist: will this be supported in Carbon
<heat>
lets devolve back into monke K&R UNIX C program
* sham1
runs
<GeDaMo>
BCPL forever! :P
<sham1>
It's evolving, but backwards
<sham1>
C23 seems promising aside from all the UwUs in the draft specs
<sham1>
And I was so looking towards #embed
<heat>
who's the weeb that wrote the spec?
<geist>
sham1: hmm, what's carbon?
<mcrod>
C23 is slowly reminding me of C++ though
<geist>
or more implrtnatly, which carbon are we talking about here?
<heat>
google experimental language cuz they got upset with c++
<geist>
ah
<mcrod>
I saw `constexpr` and it was a legitimate thing
<mcrod>
and I honestly thought the 60 year olds would have a stroke and die there.
<heat>
with constexpr C23 is no longer implementable by non-major-compiler-vendors
<heat>
cheers mate
<sham1>
auto in C will be weaker than in C++ fwiw. And oh well, constexpr will mean that I can give a name to an array size without having it suddenly become a VLA and ruining everything
<mcrod>
what do you mean?
<sham1>
If I do something like
<mcrod>
#define HEAT_BRAIN_SIZE_ARR 1
<mcrod>
there
<geist>
yah const/constexpr proper constants are a nice thing in C++
<sham1>
const size_t N = 5; heat_t heats[N]; // This will be a VLA
<geist>
having to reduce the amount of #define FOO number is pretty good in general
<mcrod>
i'm being obtuse for a reason
<sham1>
I don't count preprocessor macros, they're not typed
<geist>
right
<heat>
mcrod, did you watch the UNIX talk i linked?
<mcrod>
and that reason is the C standards people are _usually_ resistant to change
<geist>
typed constants is generally a good win
<mcrod>
heat: shit I forgot
<heat>
do it now
<heat>
benno can't wait any longer
<mcrod>
man I'm working
<sham1>
constexpr size_t N = 5; heat_t heats[N]; // This ain't no stinkin' VLA
<mcrod>
well, how much am I working, really
<heat>
there you go
<geist>
so then the question is does that reduce the 'this variable must be impemented' rule that tends to exist in C
<geist>
vs C++ where a constant doesn't always need to exist
<geist>
though i forget the precise semantics of that
<geist>
except you can generally just blat them around and not worry too much (in C++)
<zid>
I like the 'vla types but no vlas' thing because vlas suck but sizeof(a[4]) is good
<mcrod>
constexpr is fine in C
<sham1>
zid: yeah. I can finally do something like `void foo(size_t n, int (*arr)[n]) and have that work
<zid>
C already has that but for.. minimum sizes
<mcrod>
again my only point is the C standards committee is afraid of change
<mcrod>
even removing trigraphs was a minor, but nevertheless a real question
<zid>
I think you need a keyword though but I forget what it is [static 5] or whatever?
<mcrod>
hard to imagine
<mcrod>
i think the committee actually spent some time on that issue and gave it serious thought
<zid>
C standards comittee haven't bothered to extend the language with *any* of the common tropes C programmers find themselves reimplementing 400 times a year and that's just sad
<zid>
no 'length of an array' operator, so now there's a billion sizeof(a) / sizeof(a[0]) macros
<zid>
endian macros
<zid>
blah blah
<zid>
all of that could have been added in the 80s in 20 minutes
<sham1>
zid: you don't need static or const for that. In that case the compiler exactly knows that the size of the array is n
<mcrod>
[static 5] doesn't do shit in gcc
<mcrod>
the manual states this
<zid>
it warns
<zid>
if the size of an array passed in is smaller than 5
<sham1>
Because it's a pointer to an array of size n. While arr[static 5] just warns, yeah
<mcrod>
hm
<sham1>
IIRC either clang or llvm uses [static 1] as a "non-nullable" pointer
<sham1>
Well, clang/llvm
SGautam has joined #osdev
<zid>
sadly the analyzer isn't *great* about doing it for malloc, if at all
<sham1>
True. It's trying its best
<zid>
oh it treats it as a maximum inside the function at least
<zid>
<source>:1:12: note: at offset 6 into destination object 'a' of size [0, 5]
<zid>
1 | int f(char a[static 5])
<zid>
not sure I'd ever pick that up as a defensive style though
<ih8win8>
I'm writing a driver for a USB hub, and after powering on one of the hub's ports, the port turns itself off after a few milliseconds. Any idea what would cause that?
<zid>
usb power saving?
<zid>
failed negotiation / init?
<ih8win8>
Is pumping out SOF packets required to keep the port on?
<zid>
couldn't tell you any details, sorry, that was just my ideas
<ih8win8>
Ok, I'll read up on power saving.
<guideX>
do you guys think cosmos is a good way to build an os?
<zid>
So it's just a single-program bare metal virtual machine sort of deal?
<guideX>
it compiles down to bare metal also
lainon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<guideX>
I have used it in the past to make a math os, but was hoping to make something graphical
<heat>
the mckusick-karels allocator is kind of a cute idea
<heat>
i wonder if you could augment it into some slab-ish shit
<zid>
The general problem with this is that as you go to extend what it supports out of the box, you either need to personally rewrite it and make their code part of your code, or just scrap it
<zid>
this -> stuff like this
<guideX>
zid, I have modified the userkit before, yeah it can be a pita
<guideX>
adding major features is harder
<zid>
It's much easier to write a program than it is to write a compiler for said programs :p
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<mjg>
someone (i think from apple?) complained this is some offensive shit right there
<sham1>
Nethack confirms it!
<mjg>
there are also used to be offensive fortunes
<mjg>
which you had to enable to see
<mjg>
that also got axed
<heat>
yes, the unfunny theo ones
<mjg>
no
<mjg>
theo quotes are newfag
<mjg>
lemme find an example
<heat>
nope, the old fortune theo quotes
<heat>
those are not new
<mjg>
> There once was a miner named Dave, Who kept a dead whore in his cave. She was ugly as shit, And missing one tit, But think of the money he saves.
<mjg>
this kind of stuff
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<heat>
:|
<Griwes>
that fits my definition of "unfunny"
<mjg>
theo stuff is like late 90s at best
<heat>
"why are there no women in tech????"
<mjg>
Griwes: i found it hilarious around high school
<heat>
Techbros ☕
<Griwes>
most things that highschoolers find hilarious I would find unfunny
<mjg>
ok boomer
<mjg>
i just remembered there was an option to sudo to make it talk shit to you
<mjg>
if you mess up usage
<mjg>
> Listen, burrito brains, I don't have time to listen to this trash.
<mjg>
> My pet ferret can type better than you!
<heat>
cringe
<mjg>
ye not that great
<mjg>
i would almost applaud the idea, if it did not add a lol feature to a SUID program
* mjg
questiones some priorities
<zid>
heat would love though
<heat>
love what
<zid>
things that highschoolers find hilarious
* mjg
tries a fart joke
<mjg>
it's gone with the wind
<mjg>
:rimshot:
<heat>
rimshot indeed
<heat>
mjg dawg why did they have malloc if the vast majority of things were static?
<mjg>
i don't know, could be an attempt at making it not static?
<zid>
That's how most code should work, people just got lazy
<mjg>
i mean you do need a n allocator first...
<zid>
They seem to be under the misunderstanding that anybody would ever use one copy of their code, much less two copies of it, so they alloc the struct/class that their file operates on
<zid>
rather than just having a static one
<zid>
with the excuse "what if I need two?"
<zid>
The obvious response being "I'll change it to a [2] for you then"
<zid>
It's like premature optimization but, premature dynamism
<mjg>
i'm allergic to claims of premature optimization
<pogchamp>
optimize early and often
<mjg>
webtard is going to select * from loltable; and filter or count in the php code
<mjg>
when you point out how inefficient it is
<mjg>
"wow premature optimizaiton"
<heat>
pogchamp, optimize early but rarely
<mjg>
why optimize
<mjg>
computers fast
<mjg>
webdevs told me
<zid>
optimize by making it slower
<zid>
and use more memory
<mjg>
the same webdevs which now rave about rust eating only a small % of cpu
<heat>
jeez there was a guy on the fuchsia discord today that wanted protobufs for cli arguments instead of argv
<heat>
i said it was slow (plus a bunch of other problems)
<heat>
"but even the smallest microcomputer is faster than a PDP11"
<zid>
"It won't be after you're finished"
ih8win8 has quit [Ping timeout: 260 seconds]
pogchamp is now known as pog
<pog>
we have a mess of stored procs in our db to make things a little faster
<zid>
What's even faster is just not using web technologies to begin with
<zid>
keep the entire thing in memory at all time
<pog>
maybe we should stop using computers
<zid>
cus now you have enough cpu and memory to do so
<heat>
reject the internet
<heat>
use 2.11BSD
<heat>
oh wait 2.11BSD got backported networking
<zid>
as soon as you need to split it onto two machines you end up saying "ehh we'll just scale it more" and write slower and slower code, and use slower and slower techs
<heat>
man, they ruined that too
<pog>
but also what i like about efcore is that it abstracts the query so you _can_ filter and count in code and on th eback end it becomes a sql query
ih8win8 has joined #osdev
<heat>
the 8259 is a very quirky little thing
eddof13 has joined #osdev
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Left_Turn has quit [Read error: Connection reset by peer]
<immibis>
mjg: just the other day I found out a server with 60 cores and 1TB RAM costs under $2000 to buy (used). assuming there's no catch, there is no excuse for not fitting your data on one server if you're smaller than Wikipedia.
<immibis>
Stack Overflow is also a one-server-per-tier system, but uses more than one for redundancy.
<immibis>
(could run on one database server, one web server, and one offloaded search engine server)
<pog>
hi
<mcrod>
hi pog
<zid>
immibis: noo you should buy 100 $20 machines and write code that needs all of them all of the time because of all the NOSQL you use
<immibis>
the english wikipedia text dump is only 20GB
<immibis>
(compressed)
<zid>
and images can just be spread across machines via hash or something without them having to nosql or whatever
<zid>
so that should be easy too
<immibis>
that becomes a problem when you add more machines. Fortunately, disks are also quite big.
<zid>
as in, upload image, image hashes to 37, 37.images.wikipedia has it
<zid>
that's the link that's on the website
<heat>
i dont know the x86 interrupt frame by heart
<heat>
i have failed my family
<zid>
imagine wanting to know
<Cindy>
i don't know anything about x86
<zid>
good, it can be a surprise
<Cindy>
it's just graphing calculator CPU architecture
<zid>
oh you're bnchs
<Cindy>
yes
<zid>
/saveini
<klange>
My graphing calculators all came with Z80s.
<immibis>
I don't know what you're talking about. My graphing calculator uses a SuperH CPU
<Matt|home>
<heat> i dont know the x86 interrupt frame by heart <-- 80h is the only one you need trust me -_- all the others are superfluous
<klange>
I did eventually upgrade to one with an ARM9-26EJ-S
<Matt|home>
gotta love the design philosophy.. "let's make an interrupt that does literally everything" yeah ok
<zid>
it's what dos did
<heat>
Matt|home, that's not an interrupt frame, that's an interrupt vector
<zid>
there's no *real* need to spread them around, it just steals device irqs and stuff
<Matt|home>
heat : im being frivolously sued by an insurance company, if i say it's a frame it's a frame, if i say it's a vector it's a frame
<Matt|home>
or something
* Matt|home
throws his laptop out the window
<mjg>
immibis: you don't want everything served from ONE machine
<immibis>
you want it mirrored across two machines, in case one breaks
<mjg>
aka single point of falure
<mjg>
besides that had to be a rather funny power hungry machine if it costs only 2k
<immibis>
if you need a distributed consensus, you need at least 3 machines, but master/replica will do just fine for most people
<immibis>
... my last company was working on a distributed consensus on 2 machines because that's what everyone expects in the networking world. don't tell anyone it will never be bulletproof.
<immibis>
not even with STONITH
<immibis>
i mean, they weren't even planning on STONITH
<mjg>
dude
<mjg>
2 machine redundancy was a massive fetish at my first job
<mjg>
and it did not even work
<immibis>
did they put them on the same circuit in the same rack in the same data center and the power went out?
lucartc has joined #osdev
<mjg>
brah
<mjg>
i got a one up for you
<mjg>
another job had 2 redundant UPS to power DC
<mjg>
they decided to do maintenance on one of them mid-day
<immibis>
did they plug one into the other?
<mjg>
and puff, entire dc went down ofc
<mjg>
no, the physical labels on them were backwards
<mjg>
so they shifted all load to one and then powered it off
<mjg>
:]
<mjg>
as for the first job, it was 2 machines in the same rack connected with a short ethernet cable
<mjg>
basically redundnacy was only for the case where one crashes
<immibis>
it's typical for a DC to be wired with two entirely separate power circuits and servers plug into both
<mjg>
networking redundnacy classic is 2 links to a provider
<mjg>
all going in the same tunnel
<immibis>
yes and then someone accidentally digs up the 1 fiber cable
<immibis>
or the 1 bundle of fiber cables
<mjg>
btw one day $certainjob was doing spring cleaning and they found a disconnected fiber
<mjg>
turns out company was extra for a backup link
<mjg>
since it was not even plugged in, makes you wonder if failover was ever configured
<mjg>
as they say, it fails and it is over innit
<immibis>
so the lesson is test your redundancy
<mjg>
who even does that
<mjg>
the utter classic is setup it up, NEVER validate
<mjg>
adn then be afraid to do it
<immibis>
one obvious way to test would be to serve half of reads from the replica server. maybe logged-out users or something
goliath has quit [Quit: SIGSEGV]
<mjg>
what's your product
<heat>
your replica server should be a rpi running off an sd card