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
<zid`> I think you might be the ho then
<zid`> rather than the pimp
<heat> D:
<zid`> sorry you had to find out this way
<heat> OSS is the pimp and we're just the hos
<heat> GNU is like the modern day east india company
<gog> what
<zid`> I want curry
<gog> same
<heat> for $53M a year he's yours
<heat> not quite indian though
<zid`> is that a sportsball person joke
<heat> indeed
<zid`> gog: you're my friend right, pick me up and we'll go get vindaloo
<heat> a yank joke too
<zid`> you're right, sportsegg
<gog> zid`: k i'll be right over
<heat> basketball, not handegg
<gog> ima get extra naan bread
<gog> love that stuff
<zid`> popadoms pls
<gog> yes
<zid`> a tower so tall the ones on the bottom give way under the weight
<heat> i work for a trendy san fran company so I can do all sorts of bay area references now
<gog> that seals it i'm gonna go to work early so i can stop and get curry on the way
<gog> on monday
<heat> cringe
<heat> why? idk, it just is
<gog> that's fine
<gog> idc
<heat> working is a bruh moment
<gog> gal's gotta eat
<heat> do you?
<gog> yes
<gog> i literally have to eat every day
<heat> think outside the box
<heat> maybe you don't
<zid`> curry on the way to work? dang
<heat> or maybe... you eat the box?
<zid`> nowhere here opens until 5pm or whatever
<heat> icelandish curry sounds horrific btw
<zid`> we're all so lazy and feckless even the indians can't stay open all day
<gog> nah there's a pakistani joint
<gog> and i work at uhhhh idk when
<zid`> my favourite indian closed down :(
<gog> after noon
<gog> :(
<heat> :(
<zid`> I used to get 2 poppadoms, a madras or vindaloo and pilau rice with cool green and red dyed grains
<zid`> delivered to my door
<zid`> by an indian man who looked absolutely LIVID at having to deliver food
<heat> understandable
<zid`> Like I'd personally kicked him out of bed to come serve me food
<heat> maybe he was indeed sleeping until you called
<zid`> indians don't sleep, that's why they run all the 24/7 stores
<mjg_> food delivery is an ongoing issue where i live
<zid`> It's not the best here, I live in a fairly rural area
<mjg_> there is a bug in the navigation they use and it sends them 2km too far
<mjg_> each time i meet a new driver i have to explain it to them
<zid`> The nearby city does deliver here but they charge like $8 and want minimum orders
<zid`> have you considered asking the google
<zid`> to fix it
<mjg_> i don't know what they are using
<heat> maybe they use openstreetmaps
<mjg_> anyhow i remember when my fav china place closed
<zid`> we've got like 6 chinese resturants somehow
<mjg_> or even better, check this out. we decided to check out a new pizzeria
<mjg_> literally the best pizza we ever hard, A-fucking-+
<zid`> I have unreasonable demands for pizza
<mjg_> we come back next week, the old cook is gone and there is a new guy
<mjg_> pizza sucks
<zid`> It has to be made using awful fake cheese that's an inch thick
<zid`> none of this 'bumpy flatbread with a picture of a cow' nonsense
<bslsk05> ​i2-prod.liverpoolecho.co.uk: 403 Forbidden
<gog> i want a place that has good tacos
<gog> we went to one taco joint and they were so bland
<mjg_> if you don't like create your own!
<gog> like they were fresh and tasted fine except they were made for little babies
<gog> i mean i do sometimes
<zid`> I make my own weird chilli you should try it
<zid`> chili
<zid`> chillli
<gog> i should make chili
<zid`> One of those is bound to be correct
<gog> been a minute
<gog> sin or con carne?
<zid`> I don't even know how sin carne works
<gog> just add more beans
<zid`> that's like pizza sans queso
<gog> that is a thing
<zid`> see above about pizza vs travesty
<zid`> Also, fuck beans, immitation gritty tofu nonsense
<zid`> what you want is dead nimals
<zid`> chopped up into bits
<mjg_> that you killed yourself
<mjg_> personally i eat vegans
<zid`> You know how a real person-who-likes-ruining-food adds non-meat to a chillilii?
<zid`> mushrooms.
<gog> yeah mushrooms don't belong in chili
<gog> i love mushrooms
<zid`> It's really good
<gog> but idk about putting them in chili
<zid`> it's like.. spicy ground beef stew
<gog> hm
<zid`> onions, garlic, mushrooms, ground beef, chilis, soy sauce, sugar, salt
<zid`> and whatever else I find
<gog> i mean i guess that's the point of stew
<gog> just add what you have
<zid`> dark chocolate
<zid`> and to serve: onion bhaji and melted cheddar
<zid`> it's british indian mexican fusion food
<zid`> (with basmati rice and a tortilla)
<zid`> gotta get all the carb types in
<zid`> oh I forgot pasata
<gog> i've eaten weirder combos
<mjg_> i hate mushrooms
<mjg_> good grief
<gog> i'm still hungry i'm gonna eat the chips my wife got me
<zid`> I'm trying to figure out how to work an egg yolk into it
<zid`> I fucking love egg yolks
<sbalmos> you've got us self-deprecating whackos in Cincinnati who have dark chocolate and cinnamon in our meat soup we call Cincy-style chili ;)
<zid`> see, I'm not as out there as you first thought!
<zid`> It's just british-indian style
<gog> i've heard of adding coffee to chili
<sbalmos> It's a Greek meat soup thing
<sbalmos> I forget the original name
<zid`> dark chocolate's good, you only add like 1 square to a pot though
<zid`> it just gives it the vaaguest hint
<sbalmos> now coffee in the glaze for smoked chicken or something... ohhhh
<sbalmos> that's right up there with root beer BBQ glaze
<zid`> You should try dandelion and burdock
<sbalmos> I don't exactly like the aftertaste of herbicide and insecticide. ;)
<zid`> It's similar to sarsaparilla apparently
<zid`> you mentioned root beer which made me think of it
<zid`> just different roots
<sbalmos> not really sure dandelion is that. had those before in salad. burdock never tried.
<zid`> I've never eaten a danelion, wtf
<zid`> why would you do such a thing
<zid`> I've heard of nettle tea, but eating dandelions, I am fairy sure, makes you some kind of livestock
<zid`> perhaps a kind of grazing ungulate
<sbalmos> pretty good in a field greens salad
<zid`> apparently burdock is what we used before hops
<zid`> to make bitter from
<zid`> and was the inspiration for velcro
<zid`> wikipedia is fun
<sbalmos> huh, interesting
<sbalmos> the whole sarsaparilla mention made me go look back up birch beer
<zid`> also the white goo if you squeeze dandelions is latex
<sbalmos> well it beats eating white Elmer's glue
<sbalmos> :D
<zid`> I assume that's PVA
<zid`> I know how scary americans find chemical names, they avoid them as much as possible
<sbalmos> DHMO, caustic stuff
<zid`> DNA -> heredity juice, PVA -> white glue, etc
<zid`> PVA is great because you can pour it over your skin, wait a bit, then peel it all back off
CaCode_ has quit [Ping timeout: 248 seconds]
__Blackburn__ has quit [Ping timeout: 248 seconds]
<mrvn> kazinsal: you can only ungetc() one char on POSIX. Any more is implementation defined.
<mrvn> heat: scanf is perfectly fine if you use %8s and %ms for strings (fixed length or allocate to fit).
<heat> i've never seen %ms before
<heat> is it standard?
<\Test_User> yep
<mrvn> POSIX.1-2008 instead specifies the m modifier for assignment allocation
<zid`> I believe microsoft have been around for a while now heat
<\Test_User> lol
<mrvn> %ms actually makes reading strings much more like every other type. You pass the address of the variable holding the string (pointer) and all.
<heat> "%m[^\n]s"?
<heat> it looks horrible but hey, what can you do
<psykose> for C it looks quite fantastic
<heat> spoken like a true musl libc enjoyer :P
<mrvn> Would be even nicer to get it to return an iovec structure.
<psykose> am i now
<\Test_User> it's short and understandable
<\Test_User> for C++ of similar it'd be extremely long and you'd have to read it 10 times to understand it :P
<mrvn> \Test_User: std::string line; cin.getline(line)?
<\Test_User> mrvn: getline()
<\Test_User> well, fully that'd be char* line; size_t n; getline(&line, &n, stdin);
<mrvn> I kind of want an iostream constructor for classes. It's stupid to have to create and initialize an object just to override it from cin.
<mrvn> \Test_User: that would be far less readable than "%m[^\n]s"
<\Test_User> mrvn: that's the equivilent of your `std::string line; cin.getline(line)`
<\Test_User> only real difference being std::string contains both the char* and size_t
<mrvn> you assertion was that reading a line would be long and unreadable in c++ but getline is really simple.
<mrvn> (unlike in C)
<psykose> they're equally simple and understandable in all of them
<\Test_User> what I was referring to was more of this type of C++ result: "<zid`> std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');"
<mrvn> I want: auto [a, b, c] = cin >> int >> std::string >> double;
<zid`> The one true C++ way would be to generate a template for every possible format string's argument list
<zid`> then ask the compiler/linker to drop the excessive ones later
<zid`> and this should happen inside every single translation unit
<mrvn> zid`: you mean like ats::format?
<mrvn> std::format
<\Test_User> > "auto [a, b, c] = cin >> int >> std::string >> double;" aaaaaa why, why, why
dude12312414 has joined #osdev
<zid`> In other news, there's a Made in Abyss rewatch happening and I just caught this comment: "episode lucky number seven; maybe a wholesome episode today?"
<mrvn> \Test_User: so I don't have to allocate empty objects to read into
<\Test_User> you override the >>, you override the =, and you override the []
<zid`> huge grin ensues
<mrvn> \Test_User: no override for = or [], that's c++ standard
<\Test_User> why don't we override the ; as well while we're at it
<zid`> can you define custom operators yet
<psykose> that's easy, just replace every ; with ,
<zid`> I want a greek question mark operator
<\Test_User> mrvn: you are overriding the =, a, b, c aren't getting returned from cin
<mrvn> \Test_User: and >> is just an example. it would probably have to be more like: cin.get<int, std::string, double>()
<mrvn> can't pass types as argument to operators.
<mrvn> \Test_User: No, that's when you return a std::tuple and unpack it on assignment.
<\Test_User> but cin >> returns cin
<mrvn> not for that use case
<\Test_User> and auto [a, b, c] = cin.get<int, std::string, double>() also looks bad, but at least not as bad as the >>
<mrvn> First you have to make it valid c++, then you can make it look pretty
<\Test_User> ~~or you could just write it in C to start with~~
<mrvn> \Test_User: have you ever tried to write a custom scanf plugin for your structures?
<\Test_User> nope
<mrvn> probably because C doesn't allow it.
<\Test_User> ...what exactly do you mean by scanf plugin for your structures
<\Test_User> on a side note, if C has a standard struct version of C++'s std::string that'd be nice
<mrvn> In ocaml I can say %b (iirc) and then provide a function that reads a struct and returns it.
<\Test_User> eh what
<mrvn> Just like in c++ I can write operator>> for a class.
<\Test_User> I like keeping operators used for their original intention
<\Test_User> even if no one would sanely use that operator in that place anyways, keeping things the same is more readable
<mrvn> It's kind of funny. You could write `let ast = Scanf.scanf "%b" parse_ast` for your C compiler.
<mrvn> Write the whole parser as recursive scanf helper functions.
<\Test_User> ...you're talking about doing what now
<mrvn> that's ocaml syntax
<\Test_User> idk ocaml
<\Test_User> but what's the point of that
<mrvn> Same point as having operator>> defined for your classes
Likorn has quit [Quit: WeeChat 3.4.1]
<mrvn> Lets scanf read in arbitrary types.
<\Test_User> so you're talking about changing syntax from a normal function call to some other format
<\Test_User> (normal function call = function(arg1, arg2...);)
<mrvn> \Test_User: in C this would be scanf("%b", fn, &obj); or something.
<\Test_User> ...oh yeah I see what you mean now
<\Test_User> C++'s overloaded functions iirc it's called
<\Test_User> those I wouldn't really oppose having in C, though it is a bit odd
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
<mrvn> fn would be `const char * (*)(const char *, void *)`
<\Test_User> but redefining the >>/etc operator to do it I dislike
<\Test_User> XD
<mrvn> \Test_User: overloading >> wouldn't even work as the use case has to pass types. Needs to use template parameters for that.
<mrvn> I now c++23 has std::format for printing. Is there also something for scanning input?
<\Test_User> mrvn: I was taking what you were referring to to be where you can use the same function name for different ones and which one is used is determined by which type you used as args
gog has quit [Ping timeout: 248 seconds]
<\Test_User> it's kind of odd but has actual sane usages
<\Test_User> so I don't oppose it
<mrvn> \Test_User: ocaml does it without overloading.
<\Test_User> so ocaml renames it or adds an argument so it's the same function but less efficient when run
<\Test_User> (renames it as in calls it smth other than overloading)
<mrvn> No, there is only one scanf function but the "format" string gets parsed by the compiler with a bit of blakc magic into a format type that then guides the type for all the other arguments.
<\Test_User> ah
<mrvn> bit of syntactic suggar. You can do it fully functional but "format" looks much nicer.
<\Test_User> so you mean e.g. where scanf(format, arg1, arg2, etc) where the args aren't pre-declared and their type is determined by the format?
<mrvn> \Test_User: yes
<mrvn> And you have partial application: # Scanf.scanf "%d %f";;
<mrvn> - : (int -> float -> '_weak1) -> '_weak1 = <fun>
<mrvn> That's a function taking a `something (*)(int, float)` and returning something
<\Test_User> not bad, for C though I prefer having them declared beforehand for clarity to the reader (including me in a few months :P), but for other languages that aren't strict types I'd be totally fine with it
<mrvn> The comopiler doesn't yet know the type of '_weak1 but it knows you have to provide some type for it later when you use the function.
<mrvn> I guess you hate "auto" in c++ then
<\Test_User> somewhat
<mrvn> ocaml deduces the type for most things. You can annotate your code with types but you don't have to and generally shouldn't. You do specify types for module interfaces and datatypes. But not code.
<\Test_User> another thing on my list of annoyances at C++ is args being passed with &arg name on the function setup side, where it's not clear on the caller side of the called function can overwrite your variables or not
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<mrvn> you mean foo(&arg), is that calling foo(const bla&) or foo(bla&)?
<\Test_User> I mean you call foo(arg);, but the definition of foo is smth like void foo(int &arg) {arg = 3; return;}
<mrvn> yeah, from "foo(arg)" you don't know if it is pass by value, pass by reference, pass by const reference or pass to move
<\Test_User> for languages that are intended with automatic types I'm generally fine with it for stuff I want done quickly
<\Test_User> yeah
<mrvn> and all of them can be present at the same time and you get a different function depending on what arg is.,
<\Test_User> yeah when you combine that with overloaded functions it just turns into a total mess
<mrvn> and don't forget foo(double) can be called as well
<mrvn> implicit conversion is hell
<\Test_User> agreed
<mrvn> \Test_User: how do you multiply 2 uint16_t?
<\Test_User> with assembly >:)
<\Test_User> yes I also hate how C/C++/etc can overflow stuff and not tell you
<mrvn> uint16_t mul16(uint16_t a, uint16_t b) { return a * b; } is UB.
<mrvn> (well, idb)
<\Test_User> how is that undefined? it's 2 16-bit unsigned integers returning a 16-bit unsigned integer... there's no possability of getting put into a 32-bit unsigned integer for the return and questioning which step it gets cut at
<mrvn> uint16_t gets promotes to "int" before the * and then 40000 * 40000 is a signed intreger overflow.
<\Test_User> smth like uint32_t mul16... would however leave more who-knows-what available to happen
<\Test_User> ...what
<\Test_User> aaaa
<mrvn> You have to do return (uint32_t)a * b
<\Test_User> I want a C without implicit conversion :/
<mrvn> But now you compute the upper 16 bit of the multiplication and throw it way. Potentially slower.
<\Test_User> yeah
<mrvn> \Test_User: at least for the integer conversions. There is no way to disable them.
<\Test_User> I mean, conversion of the same base type I'm fine with, conversion of one type to another is bad
<\Test_User> at a minimum I'd want it to ensure unsigned/signed remains
<mrvn> yeah, I don't get that part eigther. Why not fix that? Only thing it would break are the UB cases I believe.
<bslsk05> ​www.google.com <no title>
<bslsk05> ​'CppCon 2019: Marshall Clow “std::midpoint? How Hard Could it Be?”' by CppCon (01:02:32)
<\Test_User> hour long video lol
<mrvn> and it's all about one trivial function to get the midpoint of a and b.
<mrvn> The author suggested the function to the C++ commite because it's hard to write. First 3 submissions where buggy.
<\Test_User> XD
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<mrvn> in asm I just write "(a + b) / 2"
<\Test_User> (a + b) >> 1, no division needed
<\Test_User> unless you want floats... yeah nvm
<mrvn> you have to pick asr or lsr to match the type though
<\Test_User> actually not sure how floats do with bitwise shifts...
<mrvn> but really I only need this for array indexes to uintptr_t it is.
<mrvn> \Test_User: no bitwise shift for float regs.
<\Test_User> k
<\Test_User> makes sense
liz has joined #osdev
<bslsk05> ​en.wikipedia.org: Fast inverse square root - Wikipedia
<\Test_User> lol what-
<mrvn> Indeed. when you read that code the first time it realy is a WTF moment.
<zid`> Good news, the birds are happy, it's sunrise
<zid`> that must mean it's 3:30am
<\Test_User> sunrise at 3:30 seems quite early, where does the sun set for you
<zid`> In the sky, usually
<\Test_User> *when
<\Test_User> lol
<zid`> 21:19
<zid`> full rise at 4:40 apparently, but we don't actually get night-time because the sun doesn't go below 18 degrees, only very deep twilight
<\Test_User> sounds like a pain sleeping in summer
<zid`> It's lovely
<zid`> can have a picnic outside at 2am
<\Test_User> nice
<bslsk05> ​www.webcamtaxi.com: Access denied | www.webcamtaxi.com used Cloudflare to restrict access
<bslsk05> ​www.timeanddate.com: Sunrise and sunset times in London
<zid`> Night:
<zid`> Not for this day
<mrvn> chirping has started,
andreas303 has joined #osdev
liz has quit [Quit: leaving]
CaCode has joined #osdev
<\Test_User> > signed integer overslow is undefined, unsigned is defined
<\Test_User> wait what
<\Test_User> *overflow
<\Test_User> how is signed not defined
<zid`> because different arches do different things, so it'd cripple whatever arch that is to have to do what the others do
<zid`> C being portable-80s-assembler
<\Test_User> ahhhh yes true, the different ways of handling negative numbers
<zid`> right, so all the one's comp machines would need if(overflow) adjust(); after every signed add
<\Test_User> I always just think of the modern way it's done
<zid`> or you just say overflow is UB and skip them all
<\Test_User> yeah
Burgundy has joined #osdev
CaCode_ has joined #osdev
CaCode has quit [Ping timeout: 248 seconds]
CaCode_ has quit [Quit: Leaving]
sonny has joined #osdev
<sonny> Does anyone know why windows subsystems are called personalities?
<mrvn> C++ has stopped supporting anything but two's-complement. But still archs behave differently on overflow. They trap or saturate or just warp arouns.
<mrvn> sonny: because they are called personalities on unix
<sonny> unix doesn't have subsystems
<mrvn> sonny: 64bit linux has the 32bit personality and 32bit int/pointer + 64bit long personalities. BSD has a linux personality.
<mrvn> man personality
<sonny> ok, that's cool I didn't know there was a linux thing for BSD
<moon-child> freebsd has a linux _emulator_
<mrvn> sonny: there is a debian for bsd
<moon-child> mrvn: that's different
<moon-child> afaik
<moon-child> not using the linux kernel emulation, but compiling debian userland for the freebsd kernel
<mrvn> Nope, that runs linux code in the linux personality of freebsd. it's not emulation.
<sonny> mrvn what bsd manual? I just checked freebsd but I did not see anything
<mrvn> sonny: it's a linux manpage
<moon-child> mrvn: it's literally called the linuxulator
<sonny> oh
<sonny> mrvn: "personality - set the process execution domain" -- this?
<mrvn> moon-child: debian kfreebsd is between porting to BSD and linuxulator
<mrvn> sonny: and similat other tools and manpages
<sonny> tangent, seems like windows put win32 graphics in the kernel since it was one of it's subsystems but ipc was too slow or something
<sonny> s/windows/microsoft/
<mrvn> leading to some nice kernel exploits
<mrvn> NT used to be a microkernel
<sonny> yeah, seems so
<mrvn> by the time it was released the micro kernel part of it was 3.5MB, far bigger than all of the linux kernel at the time.
<sonny> at least before NT 4
<Affliction> Didn't 9x run parts of IE in the kernel too?
<Affliction> What could possibly go right
<sonny> o.O
<mrvn> 9x was a monolithic design
<sonny> is that why you can't uninstall it? lol
<Affliction> sonny: Nah, I think that's because trident (its rendering engine) was embeddable, and was used all over the place.
<sonny> oh
<sonny> so much for seperation
<sonny> is posix an abi?
<sonny> I'm thinking if it's just an api then it doesn't seem like such a big deal to support posix in an OS
* moon-child hands sonny a fork
<sonny> oh
<sonny> right
<moon-child> (although. cygwin and midipix)
<moon-child> (midipix has a fork, right? I know cygwin does)
<sonny> I thought midipix was wip
Burgundy has quit [Ping timeout: 248 seconds]
heat has quit [Ping timeout: 244 seconds]
<mrvn> sonny: it's not a big deal to be posixish. It's a big deal to do it correctly and even bigger to certify it. The last part because it's a ton of money every time you make an update.
<mrvn> Windows was POSIX certified, Linux isn't.
<mrvn> Although in Windows they only implemented the bare essentials, none of the optional stuff that makes it actually usable. But it was certified.
<sonny> I thought they got some third party thing from someone else
<sonny> I don't recall it being certified either
GeDaMo has joined #osdev
the_lanetly_052 has joined #osdev
terminalpusher has joined #osdev
sonny has left #osdev [#osdev]
mahmutov has joined #osdev
nur has quit [Remote host closed the connection]
arch-angel has quit [Remote host closed the connection]
arch-angel has joined #osdev
vdamewood has joined #osdev
the_lanetly_052 has quit [Ping timeout: 256 seconds]
Likorn has joined #osdev
Likorn has quit [Client Quit]
the_lanetly_052 has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
terminalpusher has quit [Remote host closed the connection]
the_lanetly_052 has quit [Ping timeout: 256 seconds]
mavhq has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
mavhq has joined #osdev
dennis95 has joined #osdev
mahmutov has quit [Quit: WeeChat 3.1]
mahmutov has joined #osdev
mahmutov has quit [Remote host closed the connection]
mahmutov has joined #osdev
mahmutov has quit [Client Quit]
mahmutov has joined #osdev
Likorn has joined #osdev
Likorn has quit [Ping timeout: 256 seconds]
Likorn has joined #osdev
CaCode has joined #osdev
blockhead has quit []
foudfou has quit [Ping timeout: 240 seconds]
foudfou has joined #osdev
gog has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
<gog> mew
dude12312414 has joined #osdev
<bslsk05> ​rowrrbazzle.blogspot.com: Perkin Worbeck's Magic Newt: "Answer" by Fredric Brown (1954) (complete short-short story)
<zid`> Anyone who failed to help in creating it was then turned to stone
<bslsk05> ​rationalwiki.org: Roko's basilisk - RationalWiki
<zid`> Today is the hottest 18C ever wat
<bslsk05> ​en.wikipedia.org: Wet-bulb temperature - Wikipedia
<zid`> dew point 10.3, 60% humidity, 1015mb pressure
<zid`> 3300 feet clouds
<Andrew> Maybe I should implement a syscall that "writes the current weather for location [ebx] into [eax]"
<Andrew> Weather is important
<Andrew> (just kidding)
<zid`> you should be kidding, what if I want more than 4GB of weather
<mrvn> pointers are passsed in A0.
<mrvn> and A1
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<gog> you should just have a server that listens for messages of type get_weather
<gog> the system call does nothing but copy the message from the broadcaster to the listener
foudfou_ has joined #osdev
Vercas3 has joined #osdev
foudfou has quit [Ping timeout: 240 seconds]
wand has quit [Ping timeout: 240 seconds]
Vercas has quit [Ping timeout: 240 seconds]
Vercas3 is now known as Vercas
* kingoffrance favors fuzzy weather like fuzzy clock "mid xth century" this would be like "getting warmer"
foudfou_ has quit [Remote host closed the connection]
foudfou has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
blockhead has joined #osdev
liz has joined #osdev
janemba has quit [Read error: Connection reset by peer]
<ddevault> what are the low bits in segment registers for?
<GeDaMo> Low bits?
<ddevault> for instance, my ss for userspace is 0x10 but it comes into the ISR as 0x1b
<weinholt> that would probably be the priviledge level of the descriptor (like in the sense of CPL=3)
dennis95 has quit [Quit: Leaving]
Likorn has joined #osdev
* ddevault shrugs and OR's them with the values from the CPU
<j`ey> ddevault: whats nullable do if normal pointers can be null anyway?
<ddevault> normal pointers can only be null if you cast null to that pointer type
<ddevault> and casting is essentially telling the type system you know better
<ddevault> anyway, ta-da: https://a.uguu.se/uzLWdMrN.jpg
<liz> ddevault: nice thinkpad, and nice task switching too
<ddevault> thanks, thanks
janemba has joined #osdev
<ddevault> I'm thinking about doing context switching by setting the IST for the PIT to the thread's context struct
<ddevault> then the ISR pushes all of the registers there and switches to the kernel stack (non-preemptable kernel)
<ddevault> saves me copying the context later
<ddevault> any obvious drawbacks to this approach?
<mrvn> all the parts where you context switch not in the timer
<ddevault> these could fall back to the manual approach
<ddevault> but I'm not sure there will be many of those
<mrvn> it will be more than 0
<ddevault> examples?
<mrvn> sleep
<mrvn> yield
<mrvn> read
<ddevault> this is a micro-kernel, so no read
<ddevault> but yeah, during some syscalls it would make sense to switch contexts
<ddevault> I mean, I could also set the syscall stack to the current thread's state
<gog> a context switch will always happen during your message passing syscalls
<ddevault> right, but couldn't the syscall handler do something similar
<mrvn> gog: only if you care about performance
<mrvn> ddevault: now you have 2 places that context switch
<mrvn> fork and exit are 2 more
<ddevault> those are just syscalls, so no additional places
<mrvn> it realy makes more sense to have code to have a switch_thread function you can call from anywhere in the kernel
<ddevault> you can - it just updates the active thread's arch context pointer
<gog> yeah the possibility that a context switch could happen during any system call shouldn't be discounted, because any system call might block the calling process
<mrvn> ddevault: not the way you described your kernel stack
<ddevault> syscall/isr stack is set to the thread's arch state
<ddevault> syscall/interrupt handler pushes all of the registers there and sets %rsp to kernel_stack_top and proceeds
<ddevault> then the clean-up code sets %rsp to the current task's arch context and pops everything back off
<ddevault> am I missing something?
<mrvn> ahh, now I get it.
<mrvn> You don't have a per task kernel stack at all.
<ddevault> nope
<ddevault> one stack per CPU
<mrvn> Totally the way to go. I do that on ARM where it's even simpler because IRQs and syscalls don't write to the stack at all.
<ddevault> oh
<ddevault> great :)
<mrvn> You might add reloading the page tables to that. Have kernel page table switching for some side channel mitigation.
<ddevault> not sure
<ddevault> if I did I'd limit the system to 64G of RAM, or have to allocate new page tables (or just statically allocate more page tables)
<ddevault> kernel page tables*
<ddevault> but yeah, I will research that, and other hardening steps, in one fell swoop
<ddevault> right now it's quite easy to crash the kernel
<mrvn> Actually make the kernel thread a full task, pinned to each core, and on IRQ/syscall you task switch to the kernel thread and after you task switch back to the next thread.
<ddevault> there is no kernel thread
<mrvn> I'm saying make one
<ddevault> I mean
<ddevault> what is a thread if not something with CPU time and a stack
<mrvn> It has a stack, a page table, VM structures, ...
* ddevault shrugs
<ddevault> semantics
<ddevault> I suppose I could work with a fixed number of page tables and just reshuffle them to access different parts of memory
<ddevault> not sure it would be efficient, though
nur has joined #osdev
wand has joined #osdev
JanC has quit [Remote host closed the connection]
JanC has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
FatAlbert has joined #osdev
<FatAlbert> where is he
<FatAlbert> gog: maw
<FatAlbert> notice im still not giving up o nthe idea of me doing osdev ... i just need a car right now so i web scrape used cars platforms
<FatAlbert> yeah im broke .. but i know ill do good oen day
<FatAlbert> i know it
dude12312414 has joined #osdev
SGautam has joined #osdev
sortie has quit [Read error: Connection reset by peer]
sortie has joined #osdev
liz has quit [Ping timeout: 248 seconds]
Likorn has joined #osdev
pretty_dumm_guy has joined #osdev
pretty_dumm_guy has quit [Client Quit]
pretty_dumm_guy has joined #osdev
pretty_dumm_guy has quit [Client Quit]
heat has joined #osdev
CaCode has quit [Quit: Leaving]
mahmutov has quit [Ping timeout: 240 seconds]
SGautam has quit [Quit: Connection closed for inactivity]
<ddevault> actually putting that TSS idea into practice was... difficult
<ddevault> now my kernel does the same thing, but better(TM)
manawyrm has quit [Quit: Read error: 2.99792458 x 10^8 meters/second (Excessive speed of light)]
manawyrm has joined #osdev
liz has joined #osdev
<j`ey> can I start qemu such that it's serial is output to some tty such that you can run `screen` to connect to it? (rather than serial on stdout)
<clever> you can route it to a socket, tty, or fifo
<klange> yeah, run it in screen :smugsipemoteasifthiswasdiscord:
<\Test_User> you can use unicode emojis on IRC
<j`ey> clever: whats the syntax for a tty?
<klange> You probably don't want the tty approach if you want to connect from screen; that's for an _existing_ tty.
<j`ey> I have a program that opens /dev/ttyAMA0 on my host. I want to run linux in a vm and use the serial port exposed by that, as the serial port for my program
<bslsk05> ​www.qemu.org: Invocation — QEMU documentation
<clever> -chardev pty,id=id there it is
<clever> it creates a pty on the host, much like sshd/xterm do
<klange> `-serial` takes a device description as an argument, you don't want -chardev
<klange> You probably just want `-serial /dev/ttyAMA0` tbh
<clever> yeah, i expect -serial pty ti also work
<clever> klange: that would expose the real serial port to the guest
<j`ey> I want to expose the guest's serial port to the host
<klange> Is that not what j`ey asked for?
<clever> j`ey: do you want to expose the real serial port to the guest, or have a host program think the guest is on a serial port?
<j`ey> ^
<clever> yeah, `-serial pty` is also a valid option
<j`ey> thanks I will try that
<clever> it will be something like /dev/pts/42
<clever> and then you can open it like any other tty and talk to the guest
<klange> (and it'll print the allocated pty path on startup)
<j`ey> yes thanks, that works!
<gog> mew
<FatAlbert> i hear you
<heat> mewtwo
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<FatAlbert> j`ey j`ey laroche