<heat>
good idea, you're saving on a precious variable there
<heat>
the switch cases should be replaced with ifs and gotos
<heat>
i dont trust the compiler to carefully lay out that code like i want it to (poorly)
<heat>
defines are all preprocessed out ofc
<zid>
I compiled a thing today heat :(
<zid>
I feel bad now
<m5>
zid: drop your shithub
<zid>
I'm banned
<m5>
from shithub?
<heat>
don't compile, interpret instead
<zid>
no, the problem is the code heat
<zid>
we should have less not more
<zid>
we've already got LOADS of code
<heat>
have you tried uhhh reusing some
<heat>
recycle!
<zid>
eww disgusting
<zid>
get the fuck out
<m5>
rude
<zid>
ideal diff is -------------------
heat has quit [Ping timeout: 252 seconds]
TkTech has quit [Ping timeout: 244 seconds]
bauen1 has quit [Ping timeout: 265 seconds]
the_oz has joined #osdev
the_oz__ has quit [Ping timeout: 248 seconds]
osmten has joined #osdev
<ring0_starr>
i think i'm ready to accept that elegant looking assembly will not be translatable into elegant looking C
<ring0_starr>
when you make one look good, the other looks bad
the_oz_ has joined #osdev
the_oz has quit [Ping timeout: 248 seconds]
bauen1 has joined #osdev
m5_ has joined #osdev
alexander has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
Arthuria has quit [Ping timeout: 248 seconds]
netbsduser` has joined #osdev
alexander has joined #osdev
the_oz_ has quit [Ping timeout: 248 seconds]
Yoofie6464465 has joined #osdev
the_oz_ has joined #osdev
Yoofie646446 has quit [Ping timeout: 248 seconds]
Yoofie6464463 has joined #osdev
Yoofie6464465 has quit [Ping timeout: 252 seconds]
netbsduser` has quit [Ping timeout: 244 seconds]
vdamewood has joined #osdev
Lucretia has joined #osdev
GeDaMo has joined #osdev
the_oz_ has quit [Ping timeout: 272 seconds]
the_oz has joined #osdev
bauen1 has quit [Ping timeout: 252 seconds]
Velonie has quit [Ping timeout: 248 seconds]
Velonie has joined #osdev
<sskras>
ring0_starr: reminds me of the devilution project where folks got a bunch of debugging info big enough to start the source-exact decompilation for the entire game (Diablo 1).
<sskras>
Not an OSdev topic, so please excuse me:)
<sskras>
Only that in their case both asm and C code weren't looking elegant :D
<sskras>
(I mean the original C code)
<ring0_starr>
you can't really know how the original C looked
<kof673>
elegance was part of that ring0 > heiroglyphics and pictograms
<kof673>
it was obsoleted :D
<ring0_starr>
hard to tell if your decompiler screwed up, i was going through this one n64 game that had this switch statement that somehow made ghidra break it up into 30 different repetitive functions
<ring0_starr>
had to manually mark some addresses and re-run analysis, and then the function looked great after that
<ring0_starr>
in my case i am rewriting my own hand-written assembly into C and realizing that i'm forced, for convenience and cleanliness sake, to drop certain specifics that would come by default writing the same thing in C
<ring0_starr>
a common one is incidentally making a loop a do..while rather than while. in C you almost never do the former
bauen1 has joined #osdev
Turn_Left has joined #osdev
craigo has joined #osdev
<gorgonical>
yec n arpee
fedaykin has quit [Ping timeout: 244 seconds]
<kof673>
elegance is perhaps assuming some scope -- so i think it is only possible for NIH, or a small team....mixing code from 20 years apart, is going to have different styles. there is style versus algorithm, but
<kof673>
scope as in one function, one library, one project, ................
<kof673>
function wise and library foolish, and so forth :D
<kof673>
can say the same thing e.g. about optimizing for small code/size. arguably the only thing that matters is at the library, project, larger level, when the totals are tallied
cow321 has quit [Ping timeout: 252 seconds]
osmten has quit [Quit: Client closed]
osmten has joined #osdev
fedaykin has joined #osdev
cow321 has joined #osdev
osmten has quit [Quit: Client closed]
gildasio has quit [Remote host closed the connection]
osmten has joined #osdev
surabax has joined #osdev
osmten has quit [Quit: Client closed]
cow321 has quit [Read error: Connection reset by peer]
knops has joined #osdev
cow321 has joined #osdev
knops has quit [Ping timeout: 248 seconds]
edr has joined #osdev
knops has joined #osdev
humm has joined #osdev
goliath has joined #osdev
heat has joined #osdev
sortiecat has joined #osdev
sortiecat has quit [Remote host closed the connection]
<bslsk05>
github.com: network-unix-v6/tape1-files/bbnnet at 33ea4eff7cee66a79b81f767400fa818a1185a31 · pdp11/network-unix-v6 · GitHub
<netbsduser`>
interesting historical curiosity
<netbsduser`>
this is the original TCP/IP stack written for unix (i'm not sure if it was based on work done for vms) by BBN
<netbsduser`>
which famously saw extensive reworking by bill joy
<heat>
oh cool
<heat>
it still looks intensely crappy but the ip_input/ip_output/etc organization is already there
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
<netbsduser`>
it's all broken up and decomposed into a lot of functions
<netbsduser`>
no surprise this thing with its granularity and creation of work-queue entries and indirections through state tables was less than satisfactory in performance
<netbsduser`>
but i did indeed find it striking that a lot of core concepts stayed
<netbsduser`>
the mbufs are there and the flow prior to tcp (where it is radically different) is quite recognisable
<netbsduser`>
the forking off a separate process in the kernel where all network processing happens is quite different though
<bslsk05>
github.com: network-unix-v6/tape1-files/bbnnet-oct82/net.h at master · pdp11/network-unix-v6 · GitHub
<heat>
also that whole struct socket is barf material
<netbsduser`>
see netmain.c
<heat>
huh cool
joe9 has joined #osdev
<netbsduser`>
while joy brought in the netisr concept - possibly the original soft interrupt in unix? i wouldn't make that claim, i think it could be possible
<heat>
he created softirqs? does he know what he started?
<netbsduser`>
it's the first one i am currently aware of in unix, but i haven't looked closely so this is pure speculation
<kof673>
he created vi and c shell...........
<netbsduser`>
vms had "fork routines" prior to this which are the same basically
<netbsduser`>
vms also had ASTs which were like thread-bound softints
<netbsduser`>
they interrupt execution but only within the particular thread they're targeted at, and execution of ASTs happens at the first non-zero interrupt priority level, blocking other ASTs within that thread
<kof673>
between vi and c shell, whatever the venn diagram looks like in the middle for both, on the sides there is surely a sizable number of people who think at least one or the other is the devil
<netbsduser`>
this fork routine concept came from RSX/11m where it was an informal trick they used to reduce interrupt latency
<netbsduser`>
the vax and vms were codesigned and there was (as well as any explicit influence) this implicit influence of the vax on the architecture of unix on vax
<heat>
the problem with softirqs/softints is that they just kinda suck
<netbsduser`>
i am concerned that now i am implementing a tcp/ip stack i'm going to force the kernel to bear a softint burden it can't bear
<netbsduser`>
it's quite easy to imagine scenarios in which softint processing is happening endlessly to the exclusion of everything else
<netbsduser`>
notwithstanding the fact that the system would not be usable in that situation, it would die anyway because rcu callbacks would never run. i think linux made a flavour of rcu where completing a softint (or bh or softirq, i get them mixed up) to run another one signalled a quiescent state
<heat>
yeah that can happen
<netbsduser`>
so by doing that i could save the system from death. but notwithstanding that, since the softint is not a thread the scheduler can exert no control over them. they can monopolise execution time
<heat>
fyi bh roughly equals softirq
<zid>
If your internet is fast enough to saturate your cores via tcp/ip processing, your machine is incorectly configured, hw wise :
<heat>
so AIUI linux tries to budget its softirq processing for e.g network rx
<netbsduser`>
it may be misconfigured but if i can i don't want it to make my os unusable
<heat>
it can also thread its softirqs IIRC once the budget exceeds
<netbsduser`>
that's very fair i think
<heat>
otoh i think freebsd did away with all of the softirq stuff and just does threaded irqs
<netbsduser`>
i think that's right, possibly an influence from the solaris approach to smp where they originally dreamed of having only the scheduler use spinlocks and interrupt masking
<zid>
I have a dream, I have a dream that one day, only the scheduler will need to know the pain of having to use a spinlock
<zid>
--solaris
bliminse has quit [Quit: leaving]
<netbsduser`>
and dragonfly is doing likewise with the netisr replaced with true threads
<netbsduser`>
zid: i believe this is also the origin of why solaris mutexes can be either a sleeping mutex, or a spinlock only
<netbsduser`>
they call the spinlocks used in the scheduler explicitly as "dispatcher locks". i believe the janus faced mtx_t is an artefact of an incomplete adoption of their intention
<heat>
the problem with that is that mutexes suck
<heat>
for throughput
k_hachig has quit [Ping timeout: 268 seconds]
netbsduser` has quit [Ping timeout: 248 seconds]
gog has joined #osdev
<kof673>
#define EADDRNOTAVAIL 0x12f /* Address not available */ 7-some lines later #define EADDRNOTAVAIL 0x136 /* Address not available */
<kof673>
properly-built elks toolchain still has some fun surprises
<kof673>
eeny meeny miny mo........which one to trust......
<heat>
lol
<heat>
what's up with those errnos anyway
<heat>
too darn high up
<zid>
The only acceptable errno is -4
<zid>
It's large enough to be thoughtful but not too large to be excessive
<zid>
-1 is just too weak, makes you think they've not even thought about it
<kof673>
it is dos stuff........and some mixture of elks and newlib and ...........
<kof673>
dos stuff with some spirit of unix sprinkled in lol
hwpplayer1 has quit [Remote host closed the connection]
<kof673>
actually i already have a "no errno" path it is just to check strtoul() or similar, and fallback to atoi() but .........
Turn_Left has quit [Read error: Connection reset by peer]
Lucretia has quit [Remote host closed the connection]