night has quit [Quit: No Ping reply in 180 seconds.]
kanzure has quit [Remote host closed the connection]
kanzure has joined #osdev
netbsduser has quit [Ping timeout: 245 seconds]
onering has quit [Remote host closed the connection]
night has joined #osdev
Beato has joined #osdev
Fingel has joined #osdev
Fingel has quit [Remote host closed the connection]
Fingel has joined #osdev
craigo has joined #osdev
heat has quit [Ping timeout: 268 seconds]
vdamewood has joined #osdev
cow321_ has joined #osdev
Matt|home has joined #osdev
cow321 has quit [Ping timeout: 240 seconds]
cow321_ is now known as cow321
netbsduser has joined #osdev
netbsduser has quit [Ping timeout: 245 seconds]
netbsduser has joined #osdev
netbsduser has quit [Ping timeout: 255 seconds]
netbsduser has joined #osdev
GeDaMo has joined #osdev
gbowne1 has quit [Quit: Leaving]
netbsduser has quit [Ping timeout: 255 seconds]
netbsduser has joined #osdev
<GreaseMonkey>
how common is it for a BIOS to set DL to the wrong value when booting off a hard disk? i had to patch the FreeDOS MBR bootloader to work around my shitty BIOS
<GreaseMonkey>
i worked out the problem by forcing it to retry on failure, and i heard the floppy drive thrash, so i made use of a very generous code cave and set it to the correct value of 0x80
<GreaseMonkey>
the BIOS date string is 1998-10-19 and it's an HP Brio 8314 or something
netbsduser has quit [Ping timeout: 252 seconds]
<kof673>
i don't know, but i have seen such claims :/
Matt|home has quit [Ping timeout: 245 seconds]
Fingel has quit [Quit: Fingel]
vdamewood has quit [Quit: Life beckons]
zxrom has joined #osdev
bitoff has quit [Ping timeout: 240 seconds]
xFCFFDFFFFEFFFAF has joined #osdev
zxrom has quit [Quit: Leaving]
<zid>
GreaseMonkey: given my sample size is a single hp brio 8314, I'm going to say 100%
zxrom has joined #osdev
raykv423 has quit [Quit: Connection closed for inactivity]
duckworld_ has joined #osdev
duckworld has quit [Remote host closed the connection]
xFCFFDFFFFEFFFAF has quit [Remote host closed the connection]
op has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
duckworld_ has joined #osdev
duckworld has quit [Remote host closed the connection]
duckworld_ is now known as duckworld
heat_ has quit [Remote host closed the connection]
heat_ has joined #osdev
netbsduser has joined #osdev
goliath has quit [Quit: SIGSEGV]
<sortie>
<mjg> boo, sortix still does not have smp <mjg> wait, the wevpage even says no networking ,but that can't be correct
<sortie>
mjg: The website correctly describers the latest stable 1.0 release but does not cover the state of the nightly releases. Networking has been implemented since. SMP has not been implemented (if you want the parallelism, spin up another Sortix VM)
geist-sdf has quit [Quit: Lost terminal]
leg7 has quit [Ping timeout: 268 seconds]
Ellenor is now known as MelanieMalik
MelanieMalik is now known as MelMalik
<heat_>
sooooooo
<heat_>
how do your printks work?
<heat_>
my printk currently just prints to the main console, this is /okay/ and all but it doesn't work e.g under spinlocks as printk takes some mutexes in the normal console path
<heat_>
i want to make it more bulletproof. first step would be to redirect output to the console and to the kernel log. second step is that i don't really know how to print things if i can't grab the locks. maybe schedule stuff out for a worker thread to do?
<zid>
Mine adds a row to a circular buffer of char *
<sortie>
My Log::PrintF works in most places, it does require preemption, and cannot be used nested in the places that are used to implement it (such as locking)
<zid>
you could add a lockless insert to that pretty easily I feel
<sortie>
Its backend basically does the ANSI processing of the two dimensional table with the console contents
<zid>
on architectures that had an atomic increment and give me the old value, do those exist? :p
<sortie>
And then it informs the backing storage that the contents updated in a region and it schedules a redraw in a background worker thread
<heat_>
zid, not sure, but you can always cmpxchg
<zid>
yea wouldn't be a big deal on x86
<sortie>
heat_, the big issue with worker threads is what happens when the work queue is full, how do you allocate enough storage ahead of time? Are you willing to lose work? Does that require blocking? If so it's not quite in the background
<heat_>
i guess on llsc you probably get that for free
<sortie>
E.g. a ring buffer is a fine enough approach but it can fill up and you may lose messages
<sortie>
It might even be quite garbled if escape sequences are lost
<zid>
you're hoping to lose messages on a ringbuffer
<zid>
else it'd just be an infinitely long buffer
<zid>
:P
<zid>
You always have the *final* n entries, which is what everybody does for logs that get too big
<zid>
rotate them, aka delete the head
<sortie>
In my case it blocks until the data has been properly scheduled, which is safe and doesn't lose data, it does mean the printing may block for a moment and can't be used in any context
<zid>
It's more of an issue for the serial logging
<zid>
because that you want to happen 1:1 and it's slow
<sortie>
heat_, fun fact, my panic implementation has a contingency where it tries to kthread_mutex_trylock all the console data structures, and if it succeeds, it can retain the information on screen. Otherwise it resets the screen contents
<zid>
so you need clever buffering
<heat_>
my panic impl busts the console locks :)
<heat_>
was locked? not anymore!
<zid>
panic, buffer->head = "Help;"
<zid>
disconnect the old linked list :p
<zid>
they can fight over whose turn it is to write on a dead list
<zid>
Mmm that was pretty nice, found a random packet of FAJITA MIX
<zid>
tossed it over some chicken and peppers and had it with rice
<heat_>
whoever unlocks the console (if it was locked) is responsible for flushing the logs out
<mjg>
sortie: do you have memory reclamation implemented for low memory conditions
<mjg>
sortie: for example if one was to keep creating new files (but keeping fds open(
<sortie>
mjg, not at this time, malloc just return NULL
<heat_>
didn't extfs have some reclamation logic?
<sortie>
Not at such
<sortie>
It does try to use 10% of system memory on the filesystem cache
<sortie>
But nothing ever shrinks that actually
<mjg>
you are literally worse than openbsd man
<mjg>
:S
<sortie>
I actually use openbsd man
<mjg>
0/10 would not host a php forum on it
<mjg>
that i can somewhat believe
<heat_>
mjg you should try writing an os
<heat_>
it's harder than you believe
<sortie>
it's fun
<zid>
heat_: he's too busy making the bootloader support 4096 cores optimally
node1 has joined #osdev
<heat_>
4096 cpus is LULSCALE
<heat_>
literally laptop
<sortie>
mjg, idk, committing a fixed amount of memory to a filesystem cache seems honestly quite fine to me
goliath has joined #osdev
<heat_>
it is unix tradition after all
<zid>
just cache all the inodes etc until malloc starts to fail, then back off a quarter turn
<sortie>
My Linux livelocks like weekly because the system encountered a low memory situation and Linux tried to purge the filesystem cache but still needs to swap stuff in to make forward progress and it can't make progress fast enough and it live locks
<sortie>
That's not a problem if the filesystem cache is committed
<mjg>
but can you survive the following test: 20 mln files get created
<zid>
or was that the torque spec
<mjg>
open + close
<mjg>
not more than one open at a time
<sortie>
I hope you like N squared lol
<heat_>
more N is always better
<mjg>
i'll note it's 20 * 1000 dirs * 1000 files
<mjg>
so if the lulbehavior is coming from handling of one directory it's going to be fine
<bslsk05>
gokrazy/gokrazy - turn your Go program(s) into an appliance running on the Raspberry Pi 3, Pi 4, Pi Zero 2 W, or amd64 PCs! (114 forks/3148 stargazers/BSD-3-Clause)
<heat_>
i'm fairly sure all of the golang stuff is in go, it's in C++ if you use gcgo
<dostoyevsky2>
hmmm.. but that's also a userland written in Go, not the actual OS
<zid>
I want a looongos to run on my loooong cpu
<zid>
written in goooo
<zid>
or foooortran
<heat_>
there's a parameter to the golang build system named GOOS
<kof673>
i somewhat disagree with "the same language" that is superficial IMO, at least strictly interpreted. while this is already handwavey...."language x for kernel, language y for drivers, language z for userland" i would still call "orthogonal" -- it is when it is chaos and mix and match with no rhyme or reason that is "unorthogonal" (ignoring that ABI means -- one can argue all of this is superficial)
<kof673>
so package managers are a good example of unorthogonal perhaps :D
<kof673>
but, orthogonal to each language perhaps, if not the whole
<kof673>
> my version of an orthogonal OS yes, but i don't see a way around that
<kof673>
anything anyone else tells you -- is just their version surely?
<kof673>
wikipedia, orthogonality in a programming language: > The meaning of an orthogonal feature is independent of context; the key parameters are symmetry and consistency
<kof673>
so "symmetric to what?" "consistent to what?" there is no way around that IMO
<kof673>
even if the answer is just "internal consistency" (to itself, screw the outside world)
<kof673>
and...it was leenode that thought they could ignore conway's law or somehow supercede it :D so...you have that...
<heat_>
zid, are va_lists passed by reference or by value?
<dostoyevsky2>
heat_: Go inspired me to start with this orthogonal OS ieda
<heat_>
257) It is permitted to create a pointer to a va_list and pass that pointer to another function, in which case the original function may make further use of the original list after the other function returns.
<zid>
codegen is what you'd want, right?
<zid>
making an actual pointer might be better, for other architectures with diff conventions?
<kof673>
--version --help those are "orthogonal" minor thing, but consider a world without those, or varying with every program :D and "--" even.
<heat_>
i can't pass va_arg by value
<heat_>
sorry, va_list
<dostoyevsky2>
kof673: I think mathematics has many examples of orthogonality, where you take something established and give it a new meaning by inventing a new kind of numbers
<zid>
I mean, I just did?
<heat_>
cuz then if you consume args with va_arg in the called function, the caller can't touch va_list again
<zid>
ah you mean like that
<heat_>
The object ap may be passed as an argument to another function; if that function invokes the va_arg macro with parameter ap, the value of ap in the calling function is indeterminate and shall be passed to the va_end macro prior to any further reference to ap
<zid>
right
<zid>
idk why you're so intent on naming the body of your loop though
<heat_>
the pointer should just work though
<heat_>
i want it to be maintainable
<zid>
the body of the loop is mess maintainable?
<heat_>
because then i want to pimp my printf
<zid>
less
<kof673>
dostoyevsky2, well i would perhaps say one does not notice its presence, but the absence is glaring :D
<zid>
pimp it then, it's just whether the code is inside vaprintf or directly above it, though
<zid>
and doesn't change otherwise
<kof673>
(for OSes/computer stuff, not directed towards mathematics)
<kof673>
and this was supposedly the sign of a sysadmin -- you don't notice their maintenance/etc. it is invisible/transparent (planned, handled ahead of time, noone has to change their workflow, etc.)
<kof673>
*of a good admin
Arthuria has quit [Ping timeout: 245 seconds]
<heat_>
zid, i feel like my current impl is awful and i'm trying to untangle it
<zid>
Sounds likely
<zid>
did you wanna look at the crappy one in my bootstrap again? :P
<heat_>
nah
<heat_>
what i'll probably end up doing is writing a simple state machine
<heat_>
glibc might actually use malloc there, not sure
<zid>
just va_arg everything into an array?
<heat_>
yea
<zid>
fair
<zid>
be nice if there was a va_peek
<zid>
you wouldn't need the frankly needless allocation
<heat_>
geist, btw your printf tests are freaking amazing
<heat_>
thank you
<zid>
oh yea I got half way through porting those to C
<zid>
when you were last on the printf train
<zid>
I got interested too and wanted to write a more fleshed out printf for about 20 mins
<zid>
before I got distracted by squirrels
<geist>
heat_: oh thanks
craigo has quit [Quit: Leaving]
<geist>
reminds me i was just thinking of automating them if i haven't yet
<zid>
has anyone used $ or %n outside of an exploit
<heat_>
somehow someway someone has used %n for something just thinking they're clever
<zid>
yea I am sure, sadly, the bastards
<geist>
yeah that's the one that returns how many bytes it's written up until then? I've used that before for trying to align some column thing
<geist>
it's occasionally useful
<zid>
"Look, I can write %s%$1s to print a string twice!"
<heat_>
int total_len = sprintf(buf, "%s%n%s", first_part, &first_part_len, second_part)
<zid>
"You mean, you can use it in format attacks to leak the stack pointer"
<zid>
I did a ctf recently and it had three format string attacks :P
<heat_>
this is truly OPTIMAL stuff
<zid>
Lot of messing with %n and $
<geist>
i do like to compile with -Wformat=2 and whatnot
<dostoyevsky2>
GeDaMo: https://tristancacqueray.github.io/blog/introducing-butler <- I think this goes in an orthogonal direction, where you build on OS based on existing OSes... The question then is: What makes it an OS... and I think the answer is: Certificate vaults
<bslsk05>
tristancacqueray.github.io: Introducing Butler Virtual Operating System – Tristan's Zettelkasten
<geist>
OTOH that enables a warning that basically makes it illegal to have the format string anything but a native string
<geist>
whcih i get it, but occasionally i's useful to select a format based on something
<zid>
Yes, that's what makes something an OS in my view too, certificates
<zid>
geist: why can you not select a format though? you just _Generic around the printf rather than around the """
<geist>
that's the only way i've seen it let me do it without warning
<bslsk05>
github.com: BadBuzz/C at 3de59f901d94a71cbed8a4efc5f95dc6ccd0624d · AbstractBeliefs/BadBuzz · GitHub
<heat_>
a true musl developer would have a "fizzbuzz" string and somehow + a random offset into the string
<zid>
that's how I did my assembly one
<zid>
I printed fizzbuzz or fizzbuzz+4
<dostoyevsky2>
GeDaMo: https://www.youtube.com/watch?v=jIFjzN7dk10 <- internally arcan issues certificates that you can e.g. open windows on other servers... it has a certificate store for that
<zid>
or fizz (len=4 to write)
<bslsk05>
'Arcan 0.6.3 - I, PTY, The Fool.' by arcanfrontend (00:05:29)
<zid>
Just two C ones here though
<zid>
I'm a big fan of zid.c, who needs conditionals
<GeDaMo>
OK, it wasn't Pascal https://en.wikipedia.org/wiki/TUNIS "was a portable operating system compatible with Unix V7, but with a completely redesigned kernel, written in Concurrent Euclid."
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
<mjg>
more messing with chatgpt: "write a closure program which(...)"
<mjg>
response: Certainly! Below is a Python program that uses closures(...)
<mjg>
:d
<heat_>
just asked chatgpt to write me a printf
<heat_>
it wrote a printf that uses printf to print
<mjg>
:)
<mjg>
it is garbage innit
<zid>
makes sense
<zid>
if I were a word predictor, I'd predict printf for printing text
sbalmos has joined #osdev
heat_ has quit [Remote host closed the connection]
heat has joined #osdev
Fingel has quit [Quit: Fingel]
<Ermine>
printf(a&&b ? "%d\n" : "%.*s\n", a&&b ? i : 4*(!a+!b), "fizzbuzz"+!b*4); --- what does it do
vaihome has quit [Ping timeout: 256 seconds]
<zid>
prints either i with %d
<zid>
or the first 4 characters of 'fizzbuzz' or the last 4 characters of 'fizzbuzz' or 'fizzbuzz'
<zid>
fizz and buzz are both 4 chars long so a[0] and a[4] are the start of each string, and if you only print 4 characters you get 'fizz' or 'buzz', or if you print 8 of 'fizzbuzz' you get 'fizzbuzz', hence the a+b*4 stuff
<zid>
and str+b*4
navi has quit [Quit: WeeChat 4.2.1]
<nikolapdp>
mjg i assume you meant the programming lanuguage, in which case it's spelt clojure
<mjg>
heh, i did not notice i typoed it
<mjg>
my bad !
<nikolapdp>
lol
<nikolapdp>
got to spell right to get what you want init
<zid>
nikolapdp always gives me clojure after we cuddle
<nikolapdp>
innit
<nikolapdp>
we like our lisps here
vaihome- has joined #osdev
<heat>
i want init?
<heat>
no, dont initialize, shut down instead
<mjg>
dtor
<Ermine>
unitialized value detected
<heat>
woah you're signing up to add KMSAN to onyx? okay then!
<mjg>
how do you say PESSIMAL in portugese
<mjg>
is it onyx
<heat>
péssimo
<heat>
keep that saved for posteriority
<heat>
how do you say that in polish?
<heat>
kwaszszwa?
<mjg>
"skurwiała sraka"
<vaihome->
hi guys, I am buying a Core i7 machine today
<heat>
my printf is passing all the tests
<heat>
subscribe to my onlyfans
zxrom has quit [Quit: Leaving]
<zid>
now add some $ and %n tests
<sortie>
'another day ssh'ing into my OS and compiling php on it
<heat>
i'm not supporting $ nor %n
<heat>
i will be supporting however pimped up specifiers
<sortie>
You can get away without $
<heat>
want to print an ipv4 address? don't worry, you'll be able to do that
<sortie>
Lack of %n will blow up in your face
<heat>
why?
<sortie>
It's too used by ports in practice
<heat>
this is for the kernel
<zid>
%n in kernel sounds sick for exploits, add it
<heat>
new kernel rule every printf must have a %n
<zid>
I'm sure I can make a HID device with %n as its device name or something
zetef has quit [Remote host closed the connection]
<zid>
my monitor has a message for you
<zid>
it said squiggle, box, squiggle, hdmi symbol, dvi symbol, squiggle, squiggle, 1
<zid>
I think it was trying to tell me that hdmi 1 just connected, but the font indexing was all broken
<heat>
wow that's so racist
<heat>
believe me i speak monitor
<kof673>
squiggle is a technical term for tilde in some circles
<dostoyevsky2>
kof673: some circles with a tilde in it?
<heat>
i actually wrote vfprintf with some concept of a stream
<heat>
i'll probably switch it to a more buffer-focused vsnprintf when i merge it
<heat>
just to avoid the indirect calls. printk will just write to the ring buffer anyway
heat has quit [Remote host closed the connection]
Arthuria has quit [Ping timeout: 268 seconds]
heat has joined #osdev
leg7 has quit [Remote host closed the connection]
<geist>
vaihome-: didja get it?
<nikolapdp>
vaihome-: nice, i got a r7 recently :)