<kof673>
quote gnu.org: Can the US Government release a program under the GNU GPL? (#GPLUSGov) If the program is written by US federal government employees in the course of their employment, it is in the public domain
<kof673>
well that clears that up j/k :D > The Most Important Office In A Democracy Is The Citizen www.democracy.community
<kazinsal>
actually this one's a 286 system but I need to do some major recappage on the floppy riser board
<sortie>
286? You must be wealthy
<kazinsal>
two of the voltage fliter caps went bang and I need to replace them
<kazinsal>
once they're replaced the 3.5" disk drive should work again
Turn_Left has quit [Ping timeout: 255 seconds]
Turn_Left has joined #osdev
<mcrod>
tell me something
<mcrod>
for those who are on arch with wayland+nvidia, is firefox wildly unstable
<mcrod>
it was not like this until I updated
X-Scale has joined #osdev
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #osdev
gcoakes has joined #osdev
lain` has quit [Remote host closed the connection]
lain` has joined #osdev
dgz has joined #osdev
lain` has quit [Remote host closed the connection]
dgz has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
lain` has joined #osdev
X-Scale has quit [Ping timeout: 256 seconds]
vdamewood has joined #osdev
navi has quit [Quit: WeeChat 4.2.3]
navi has joined #osdev
xenos1984 has joined #osdev
lain` has quit [Ping timeout: 260 seconds]
memset has quit [Ping timeout: 260 seconds]
<gog>
mcrod: workss fine for me
<gog>
when did you update? maybe i'm behind
<gog>
seemss i am
<heat>
hi behind, i'm heat
vdamewood has quit [Quit: Life beckons]
Arthuria has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
memset has joined #osdev
<adder>
hi heat
<gog>
heat
<gog>
hi
<sham1>
hi
<heat>
gog
<heat>
sham1
<heat>
adder
<adder>
heaten
<adder>
bom dia
<heat>
olá
<heat>
gog, egl-wayland 1.1.14 seems to be correct but fucks up firefox and OBS at least, do not update
<guideX>
what do you guys do with errors, my errors in my os are not what I desire, any error causes kernel panic, also I can wrap things in try/catch but I don't have an exception class to properly catch what error it was
<guideX>
it'd be nice to like gracefully handle the errors, and return a description of what happened to the user somehow, instead of haulting the system, eh I'm still trying to figure that out
<sortie>
guideX: Doing a custom design or a POSIX?
<guideX>
this is a custom os
<sortie>
In POSIX systems, the system calls return a well known error code such as ENOENT (no such file or directory) on failure
<guideX>
based off of.NET 7 Native AOT
<guideX>
ah ok
<sortie>
Generally I encourage you to always handle errors, including allocation failures, and gracefully clean up and abort the operation, then return an error code showing what happened
<sortie>
It's just good software practice in general
<guideX>
this is more like, an unhandled null reference exception usually
<sham1>
But malloc never fails™
<guideX>
it haults the system, and I display kernel panic
<guideX>
eh i'll work on that
<sham1>
So it's totally okay to halt and catch fire with the program on alloc failure
<sortie>
sham1: That is a choice you have to made. Usually that means you explode randomly later on a benign memory opertation.
<sham1>
Oh of course
<sortie>
E.g. overcommit (random boom), or blocking indefinitely on memory to become available (deadlock)
<heat>
overcommit is based
<sortie>
Plus on a real production kernel, you want to never crash on errors
<sortie>
Sortix doesn't overcommit and malloc returns NULL btw
<guideX>
sortie, the problem with that is, then I don't return what happened, that's no ok either I need to fix that huh
<heat>
onyx overcommit does not return NULL
<heat>
s/overcommit/malloc/
<sham1>
overcommit is cringe
<guideX>
you see, the .net7 exception isn't part of my code, so there is no exception, and the one from .net7 doesn't work in .net7 native aot, so I need to figure something else out i guess
<heat>
puck, could you enable the bslsk05 sed message thingy here please? it's really useful
<sortie>
guideX: There's two different kinds of errors that can happen. 1) Well known predicted errors (such as missing files, allocation failures, etc.) that you want to handle 2) Unexpected errors that means the code is buggy and cannot reasonably recover. A null pointer access is usually that. Even with exceptions in a managed language like .NET, you will want the equivalent of a kernel panic if you detect the kernel itself is faulty
<guideX>
sortie, ah oik
<heat>
counter-point: linux rarely panics but OOPSes instead, which is not quite the same thing
<guideX>
so only show the user errors which are expected, and things like I screwed up should hault
<guideX>
like unreferenced variable I'm trying to touch
<guideX>
ok cool
<sortie>
E.g. in the Dart programming language I worked on, we have Errors and Exceptions being two different things, where one means it's a bug in the problem and the other one means a predicted runtime issue that can be recovered from
<puck>
heat: i will in a bit, because my gpg agent has died
<heat>
thanks <3
<guideX>
In a program I am writing, I would usually handle all exceptions I can, even ones I don't know about, and have a logging mechanism, I guess not so much here as it's an os there's different reasons to do things
<sortie>
So e.g. in your system call implementations in a managed language, you don't want to catch everything, you want to panic on an unhandled exception, and to fail gracefully on expected exceptions
<guideX>
https://pastebin.com/raw/wLMyR0Tt I guess I need to figure out how to gracefully bubble this back to the user without haulting sometimes
<sortie>
Yeah I suggest kinda not doing that at least initially
<sortie>
That right there is not a system call
<sortie>
That is a CPU exception handler, e.g. the program crasher
<sortie>
The right choice initially is probably to kill your program and let it crash, from a simple implementation point of view
<sortie>
And if it is the kernel, to probably panic too
<sortie>
But later on, when you're ready, the question is how to dispatch a null pointer exception to the failing thread
<nikolar>
SIGSEGV
<sortie>
Since you're using .NET, there has to be some sort of ABI for how to dispatch those exceptions. You need to do that.
<sortie>
nikolar: Indeed but guideX is working on a .NET managed language with a custom system interface, so they need to think up their own design for this when ready
<nikolar>
Ah right
<sortie>
guideX: I'm guessing that in cases like this, you want to try to deliver the exception to userspace, and if that mechanism fails, then you want to forcefully kill the process.
<sortie>
It's up to you also whether you want to deliver null pointer exceptions to the kernel itself
<guideX>
ah ok interesting
<guideX>
yes this is in the kernel
<guideX>
if I'm like playing with it, and screw up I give myself kernel panic xD
<guideX>
I guess that's ok, it kind of should be like that in the kernel, and not like that in the os code
<sortie>
I would suggest you start out with maybe delivering an exception across a system call boundary or something
<sortie>
Learn a bit from that
<sortie>
Although the .NET mechanism for null pointer accesses are very different I suppose. I think that it actually just lets it crash natively and catches the access violation exception from Windows and uses it to then throw an exception in the calling code.
<sortie>
You'll have to study that ABI :)
<guideX>
yeah I'll look into that
<sortie>
Since you're saying it's .NET AOT that means it's anyone's guess how it handles these, if at all
<heat>
<sortie> And if it is the kernel, to probably panic too
<heat>
nooooooooooooooo
memset has quit [Remote host closed the connection]
<heat>
i've slowly over time been fully converted into "panic is bad"
memset has joined #osdev
<heat>
linox handles most crap conditions as "meh, SIGKILL and we'll deal with it later" or similar
<heat>
which basically allows you to debug easier or even just keep running indefinitely
<heat>
could crash right after, could never crash for the next 10 months, you don't know
<mjg>
lol
<heat>
oh look here's mr kernel debugger
<mjg>
how tf how getting a dump as soon as the problem is found makes "debug easeir"
<sortie>
heat: It is a bit of a mixed bag. Yes, generally, they are bad. Recoverable situations must be recovered from gracefully. BUT there is also a class of situations, like asserts or bug checks and so forth, where you realize a key kernel invariant has been broken. You can panic now and say what's wrong and it can be fixed, since it's a kernel bug. Or you can keep going and you're going to explode mysteriously, and attackers are going to exploit the
<sortie>
broken invariants to root the kernel.
theyneversleep has joined #osdev
<mjg>
not*
<guideX>
I feel like if I hide the errors I will get complacent and system will be unstable xD
<guideX>
I mean I could just add try/catch everywhere, but idk
<sortie>
Personally I follow the pattern where I handle all errors gracefully. If it panics, then I make it a P0 to debug and fix that crash,.
<mjg>
i think you missed the part where even companies like red hat enable panic on oops
<mjg>
and get crashdumps
<mjg>
not everything can be debugged from an oops report
<heat>
i mean, yeah if you can get crashdumps then panic on oops is a solid choice
<mjg>
lemme tell you what does not crash on oops: fucking arch desktops
<sortie>
guideX: It is indeed important that errors are caught and brought to your attention and that you make it a priority to fix them
<heat>
or if you have a debugger ready to attach
<mjg>
and similar
<sortie>
*that kernel bugs
<heat>
i know
<guideX>
sortie, yueah cause, I'm sure I'll just get lazy, and it'll get ridiculous
<guideX>
like some excel spreadsheet importer I don't really care that much about xD
<mjg>
there are very few problems one can merely reported
<mjg>
report
<heat>
idunno i rarely see crashdumps being shared around
<sortie>
In osdev, it's important imo to do things right, always, and think ahead and design very good primitives for everything
<mjg>
heat: that's because there is no culture to do it on linux
<sortie>
But hey when you're getting started, have fun making things work, then clean up and improve incrementally
<mjg>
most notably you would need to carve out a chunk of ram for kexec
<mjg>
merely to support crashdumps
<sortie>
how dare you I downloaded all of my ram
<mjg>
meanwhile this is a mosty solved problem elsewhere: you have dedicated code which performs direct writes to swap
<heat>
what's elsewhere?
<mjg>
so there is no prep needed modulo a swap partition
<mjg>
fucking SOLARIS even
<sortie>
~linux
<mjg>
or any bsd
<mjg>
you may not know this but before 2010 linux was not the only game in town
* sortie
does not have a kernel debugger anymore in Sortix
<mjg>
and the need to collect crash info was already there
<sortie>
(it was too bad and I removed it)
<mjg>
sortie: see i can give mild props to linux here, the crash debugger is quite ok
<heat>
what happens if you need to write directly in the bad kernel, but the bad kernel is bad and re-crashes?
<mjg>
in fact it contains features the solaris people tried to brag about in their own debugger
<sortie>
Local Man Commends Linux Crash Debugger Experience
<heat>
like, the crash kernel makes sense
<mjg>
heat: thje writing code is isolated
<mjg>
i have never seen a case where *that* also panicked
<mjg>
but in that spirit what if kexec'ed kernel panics
<heat>
doesn't matter, goes through a helluva common paths
<mjg>
's likem on
<mjg>
no it does not, it's part of the point
<guideX>
some kind of dumb scenarios A) when my kernel detects there's no keyboard or mouse, is that a hault? (I would suspect it would load the os without them) B) when the os code can't find the png file for the gui, halt? (I suspect I can use a generic image, and not hault, or just not load that icon and recover gracefully, currently it halts) C) when the kernel detects a null value in a variable (I presume halt)
<mjg>
guideX: if your kernel does not need mouse nor keyboard, why would it halt
<GeDaMo>
"Keyboard not found, press F1 to continue"
<guideX>
mjg, it needs both
<mjg>
i was gonna say that
<guideX>
without that, it will just be useless
<zid>
GeDaMo: F13 is my favourite
<mjg>
the proper response to not fiding a keyboard is asking them to press F1 to continue anyway
<zid>
it has a scancode I think?
<guideX>
yes exactly, I scancode
<heat>
mjg, swap - block - pci - irqs - nvme/ata/ahci/ide/usb/whatever. you dupe all of these pathen?
<GeDaMo>
Probably something like Ctrl+Alt+F1
<mjg>
heat: you wriet miniminal fucken' code to do a block write to it
<mjg>
heat: probably not usb tho, but regular storage
<bslsk05>
www.smidgeup.com: The Scottish Midge Forecast - Smidge
<zid>
oh, like the rest of the inhabitants then
<zid>
bloody picts
<heat>
mjg, but if you don't have a crash kernel and you don't have a way to coredump externally, oops is your best bet
<mjg>
heat: in linux as implemented at the moment, yes
<mjg>
heat: but this is not an inherent property
<heat>
the mere power of dmesg | nc termbin.com 9999 and getting the logs out of there is great
<heat>
and *probably* works if things didn't go mega terribly wrong
<mjg>
you do understand oops outoput does not necessarily contain what's needed to find out wtf
<heat>
yes i do understand that
<mjg>
trivial example, say you oopsed on being stuck somewhere, but you dont' know why you are stuck
<mjg>
this can be improved, but afaics nobody is doing it
<mjg>
cause people who really care already have kexec and full dumps
<heat>
like, i know this isn't anywhere near a replacement for coredumps, but it's your best bet if you don't have them, and could very well help
<mjg>
it is *something* for sure
<mjg>
probably sufficinet when actively developing something
<mjg>
as for end users it's so-so
<heat>
on onyx i've been sufficiently screwed by panic messages scrolling out of sight :)
<mjg>
that's another bug in a bug, freebsd has that too
<mjg>
a de facto panic can be a series of printfs
<mjg>
have several cpus hit that and the screen is spaghetti
<mjg>
you probably want to increase the size of the magic console buffer
<heat>
not just that but e.g i can't see a KASAN panic screen fully cuz of the sheer amount of info dumping i do
<mjg>
and more importantly: recover it after reboot
<mjg>
probalby not a thing the way you handle onyx at the moment tho
<mjg>
well in that case you should be printing shit to a serial port
<mjg>
and log that on the host
<heat>
yeah i do recover logs after boot
<heat>
reboot i mean
<guideX>
do all these weird questions bother you guys? just checking, there's like thousands more xD
<guideX>
trying to ask them only a few a little at a time xD
<guideX>
the really important ones
<sham1>
I think that if they were bothersome, people wouldn't answer
<heat>
recovering it *used* to be really easy cuz i had a simple text buffer that didn't wrap like a proper ring buffer, now i should probably have a userspace program deal with it
<mjg>
if you have a proper ring buffer you are set
<mjg>
you find the original end
<mjg>
add a 'booting mofo' message
<mjg>
and start from there
<mjg>
you can literally pick up as if nothing happened
<heat>
oh *that* is not possible
<mjg>
how so
<mjg>
fbsd is doing that
<mjg>
does your msgbuf wander around?
<heat>
1) printk buffer is in .bss 2) onyx does physical KASLR
<mjg>
8s
<mjg>
well then serial port it
<heat>
i use qemu and memsave it
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
tbvdm has quit [Quit: leaving]
Arthuria has quit [Ping timeout: 276 seconds]
Arthuria has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
<heat>
mjg, do you know where people usually free the old thread struct/thread stack?
<nikolar>
KERNAL
<heat>
i'm thinking RCU here, i had a DPC thread but it sucks some ass
<heat>
and RCU *sounds* like the perfect solution here
<heat>
could also take the L and do it mid context switch but sounds terrible
<nikolar>
Is there ever a situation where rcu isn't a good solution
<Matt|home>
o\
<gog>
it volates one of my core tenets
<gog>
reading? totally cool. copying? always copy things you like
<gog>
updating? no
<gog>
never update
<mjg>
heat: it's the context switch
<mjg>
and it's bad too
<mjg>
fucken spinlock in there
<mjg>
(lol)
<heat>
OH if debian is so stable why does it have read copy *update*???
<heat>
mjg, so RCU batching sgty suggested-by: Mateusz Guzik?
<mjg>
no suggestions
<mjg>
's all crapper
<heat>
ok never free sgtm ok heat@
<mjg>
there you go
<mjg>
if you did not need the process why tf did you create it
<mjg>
111
<nikolar>
Resource reclamation is overrated
<heat>
amen
<heat>
if free wasn't a thing you'd think twice before calling malloc
<heat>
thus memory usage would go down
<nikolar>
Indeed
<nikolar>
Also can't use after free if you don't free
<Matt|home>
https://i.ibb.co/pRdMLW1/IMG-1135.jpg <-- i feel like an l337 hax0r from hackers or swordfish or smth :D ima call myself... ...... infinityText >:D
<nikolar>
Ew visual studio
<Matt|home>
shush u, VS is great
<nikolar>
No it ain't
<nikolar>
msvc is the worst
* Matt|home
pets nikolar
* nikolar
gets confused
<Matt|home>
so whats your major gripes with it?
<nikolar>
For a start, it's a c++ compiler cosplaying as a c compiler
<Matt|home>
also keep in mind, a fantastic reason for me to make this and qt my primary IDEs are cuz i get free 24/7 tech support with tme
<Matt|home>
them*
<nikolar>
How so
<heat>
c++ has nothing to do with visual c being bad
<heat>
well, mostly
<Matt|home>
my sister is some kinda dev and it's her favorite editor of all time so if i ever have trouble with it i just ask her and she tells me what to do :D
<nikolar>
Has she tried anything else :P
<heat>
visual c is bad cuz they dgaf, because they're on the C++ copium
* Matt|home
eyerolls
<heat>
so it's somewhat culpable, but not really
<Matt|home>
in all seriousness i've never run into a problem with VS before. VScode, yes (fuck linux)
<Matt|home>
VS on MS, no
<heat>
msvc is terrible for many other reasons though, even the C++ bits
<Matt|home>
still waiting to hear those reasons :p
<Matt|home>
oh vc, sry
<heat>
codegen is garbage, features are miles off of gcc and clang
<nikolar>
Agreed
<heat>
warnings are shit, default warnings are shit and annoying
<nikolar>
> VScode, yes (fuck linux)
<Matt|home>
im using visual -studio- . that's different from vs code right?
<nikolar>
What's Linux got to do with that
<Matt|home>
e.g. vc
<Matt|home>
i don't wanna get into it, too long of a story and i've already spent hours ranting
<heat>
vc is visual c
<heat>
it's visual studio's compiler
<Matt|home>
never used it
<heat>
yes you did
<nikolar>
Lol i meant what does vs code sucking have to do with Linux
<Matt|home>
ah
<Matt|home>
wait a minute. im 99% sure im using gcc, lemme check
<nikolar>
In vs?
<heat>
modern vs does support clang-cl at least, so there's that
<nikolar>
Lel
<Matt|home>
yeah i dunno where to find what compiler it's using rn
<heat>
also technically linux gcc(?) development. no idea how
<Matt|home>
i know you can change settings, e.g. it was extremely easy to switch from whatever version i was using to C++17 , so im assuming it's trivial to switch compilers as well
<heat>
lol no
<nikolar>
In uni, when we were using c in a class, their recommendation was to download a 10gb visual studio install just to use a c compiler
<nikolar>
Which is very silly
<heat>
meh
<heat>
visual studio is the friendliest approach to C
<nikolar>
Matt|home: it's very much not easy
<Matt|home>
anyhoo i gotta get back to work, i wanna at least get a working commandline interface going before i get stoned today
<heat>
keep this in mind: most uni tutorials say "just do gcc main.c -o program" which misses the whole of everything good about these compilers
* Matt|home
packs a bowl lights it and passes it around
<nikolar>
heat: well we didn't get anywhere close to that
<heat>
C without warnings is absolutely unusable by hoomans
<nikolar>
My uni is for some reason allergic to the command line, I swear, most of the other students wouldn't know how to write and execute a line of code if there wasn't a big play button in front of them
<heat>
well if not for the command line, your alternative would be... codeblocks? fuck that lol.
<heat>
clion but that's too modern
<heat>
(and equally humungous)
<nikolar>
Command line for the win
<nikolar>
My friend once asked how to do something in the command line, instead of through eclipse, and the instructor's response was like, why'd you want to use the command line, that's outdated and no one's using it anymore
<nikolar>
Lel
dgz has joined #osdev
lain` has joined #osdev
<gog>
hi
<nikolar>
ou
* Matt|home
tackles & snuggles gog
<Matt|home>
<3
<gog>
o:
<nikolar>
Thought you left to do something productive :P
<gog>
i'm doing nothing productive today
<Matt|home>
yeh but im still sitting in front of the monitor
<gog>
that's not true though i cleaned a little
<gog>
i don't wnat to clean though i'm tired of being the one who cleans
<Matt|home>
hm. not sure how im supposed to do this. i need this function to return either an integer _or_ a memory address. that's annoying. (don't help me im just talking out loud)
<zid>
hire a filipino maid in a short skirt
<zid>
I can't afford it so I just get nikolar to wear it
<nikolar>
Good luck with that
<Matt|home>
i guess i could just have it return NULL in case of error, but i like the idea of returning 0 on success
thinkpol has quit [Remote host closed the connection]
Gooberpatrol66 has quit [Ping timeout: 276 seconds]
thinkpol has joined #osdev
X-Scale has quit [Quit: Client closed]
Tetsuo has joined #osdev
Tetsuo has quit [Ping timeout: 260 seconds]
snowcra5h has joined #osdev
theyneversleep has quit [Remote host closed the connection]
op has joined #osdev
janemba has quit [Read error: Connection reset by peer]
netbsduser has quit [Ping timeout: 252 seconds]
gcoakes has joined #osdev
Cesarww has joined #osdev
<Cesarww>
hi, im trying to use limine_terminal_request function to make a print function but it gives this error: ``` error: expected unqualified-id before ‘.’ token