Search logs:

channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present


http://bespin.org/~qz/search/?view=1&c=osdev2&y=22&m=6&d=19

Sunday, 19 June 2022

00:00:00 <zid`> I think you might be the ho then
00:00:00 <zid`> rather than the pimp
00:00:00 <heat> D:
00:00:00 <zid`> sorry you had to find out this way
00:01:00 <heat> OSS is the pimp and we're just the hos
00:02:00 <heat> GNU is like the modern day east india company
00:02:00 <gog> what
00:02:00 <zid`> I want curry
00:03:00 <gog> same
00:05:00 <heat> for $53M a year he's yours
00:05:00 <heat> not quite indian though
00:05:00 <zid`> is that a sportsball person joke
00:05:00 <heat> indeed
00:05:00 <zid`> gog: you're my friend right, pick me up and we'll go get vindaloo
00:06:00 <heat> a yank joke too
00:06:00 <zid`> you're right, sportsegg
00:06:00 <gog> zid`: k i'll be right over
00:06:00 <heat> basketball, not handegg
00:06:00 <gog> ima get extra naan bread
00:06:00 <gog> love that stuff
00:06:00 <zid`> popadoms pls
00:06:00 <gog> yes
00:06:00 <zid`> a tower so tall the ones on the bottom give way under the weight
00:07:00 <heat> i work for a trendy san fran company so I can do all sorts of bay area references now
00:07:00 <gog> that seals it i'm gonna go to work early so i can stop and get curry on the way
00:07:00 <gog> on monday
00:07:00 <heat> cringe
00:07:00 <heat> why? idk, it just is
00:08:00 <gog> that's fine
00:08:00 <gog> idc
00:08:00 <heat> working is a bruh moment
00:08:00 <gog> gal's gotta eat
00:08:00 <heat> do you?
00:08:00 <gog> yes
00:08:00 <gog> i literally have to eat every day
00:08:00 <heat> think outside the box
00:08:00 <heat> maybe you don't
00:08:00 <zid`> curry on the way to work? dang
00:08:00 <heat> or maybe... you eat the box?
00:09:00 <zid`> nowhere here opens until 5pm or whatever
00:09:00 <heat> icelandish curry sounds horrific btw
00:09:00 <zid`> we're all so lazy and feckless even the indians can't stay open all day
00:09:00 <gog> nah there's a pakistani joint
00:09:00 <gog> and i work at uhhhh idk when
00:09:00 <zid`> my favourite indian closed down :(
00:09:00 <gog> after noon
00:09:00 <gog> :(
00:09:00 <heat> :(
00:10:00 <zid`> I used to get 2 poppadoms, a madras or vindaloo and pilau rice with cool green and red dyed grains
00:10:00 <zid`> delivered to my door
00:10:00 <zid`> by an indian man who looked absolutely LIVID at having to deliver food
00:10:00 <heat> understandable
00:10:00 <zid`> Like I'd personally kicked him out of bed to come serve me food
00:11:00 <heat> maybe he was indeed sleeping until you called
00:12:00 <zid`> indians don't sleep, that's why they run all the 24/7 stores
00:12:00 <mjg_> food delivery is an ongoing issue where i live
00:12:00 <zid`> It's not the best here, I live in a fairly rural area
00:13:00 <mjg_> there is a bug in the navigation they use and it sends them 2km too far
00:13:00 <mjg_> each time i meet a new driver i have to explain it to them
00:13:00 <zid`> The nearby city does deliver here but they charge like $8 and want minimum orders
00:13:00 <zid`> have you considered asking the google
00:13:00 <zid`> to fix it
00:14:00 <mjg_> i don't know what they are using
00:14:00 <heat> maybe they use openstreetmaps
00:15:00 <mjg_> anyhow i remember when my fav china place closed
00:15:00 <zid`> we've got like 6 chinese resturants somehow
00:15:00 <mjg_> or even better, check this out. we decided to check out a new pizzeria
00:15:00 <mjg_> literally the best pizza we ever hard, A-fucking-+
00:16:00 <zid`> I have unreasonable demands for pizza
00:16:00 <mjg_> we come back next week, the old cook is gone and there is a new guy
00:16:00 <mjg_> pizza sucks
00:16:00 <zid`> It has to be made using awful fake cheese that's an inch thick
00:16:00 <zid`> none of this 'bumpy flatbread with a picture of a cow' nonsense
00:17:00 <zid`> https://i2-prod.liverpoolecho.co.uk/incoming/article11085721.ece/ALTERNATES/s615/JS53147434.jpg This is a pizza
00:17:00 <bslsk05> ​i2-prod.liverpoolecho.co.uk: 403 Forbidden
00:17:00 <zid`> https://www.nonnabox.com/wp-content/uploads/pizza_napolitana.jpg This is a travesty
00:17:00 <gog> i want a place that has good tacos
00:17:00 <gog> we went to one taco joint and they were so bland
00:17:00 <mjg_> if you don't like create your own!
00:17:00 <gog> like they were fresh and tasted fine except they were made for little babies
00:17:00 <gog> i mean i do sometimes
00:18:00 <zid`> I make my own weird chilli you should try it
00:18:00 <zid`> chili
00:18:00 <zid`> chillli
00:18:00 <gog> i should make chili
00:18:00 <zid`> One of those is bound to be correct
00:18:00 <gog> been a minute
00:18:00 <gog> sin or con carne?
00:18:00 <zid`> I don't even know how sin carne works
00:18:00 <gog> just add more beans
00:18:00 <zid`> that's like pizza sans queso
00:19:00 <gog> that is a thing
00:19:00 <zid`> see above about pizza vs travesty
00:20:00 <zid`> Also, fuck beans, immitation gritty tofu nonsense
00:20:00 <zid`> what you want is dead nimals
00:20:00 <zid`> chopped up into bits
00:20:00 <mjg_> that you killed yourself
00:20:00 <mjg_> personally i eat vegans
00:20:00 <zid`> You know how a real person-who-likes-ruining-food adds non-meat to a chillilii?
00:20:00 <zid`> mushrooms.
00:21:00 <gog> yeah mushrooms don't belong in chili
00:21:00 <gog> i love mushrooms
00:21:00 <zid`> It's really good
00:21:00 <gog> but idk about putting them in chili
00:21:00 <zid`> it's like.. spicy ground beef stew
00:22:00 <gog> hm
00:22:00 <zid`> onions, garlic, mushrooms, ground beef, chilis, soy sauce, sugar, salt
00:22:00 <zid`> and whatever else I find
00:22:00 <gog> i mean i guess that's the point of stew
00:22:00 <gog> just add what you have
00:22:00 <zid`> dark chocolate
00:23:00 <zid`> and to serve: onion bhaji and melted cheddar
00:23:00 <zid`> it's british indian mexican fusion food
00:23:00 <zid`> (with basmati rice and a tortilla)
00:23:00 <zid`> gotta get all the carb types in
00:25:00 <zid`> oh I forgot pasata
00:25:00 <gog> i've eaten weirder combos
00:25:00 <mjg_> i hate mushrooms
00:25:00 <mjg_> good grief
00:25:00 <gog> i'm still hungry i'm gonna eat the chips my wife got me
00:25:00 <zid`> I'm trying to figure out how to work an egg yolk into it
00:25:00 <zid`> I fucking love egg yolks
00:25:00 <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 ;)
00:26:00 <zid`> see, I'm not as out there as you first thought!
00:26:00 <zid`> It's just british-indian style
00:26:00 <gog> i've heard of adding coffee to chili
00:26:00 <sbalmos> It's a Greek meat soup thing
00:26:00 <sbalmos> I forget the original name
00:27:00 <zid`> dark chocolate's good, you only add like 1 square to a pot though
00:27:00 <zid`> it just gives it the vaaguest hint
00:28:00 <sbalmos> now coffee in the glaze for smoked chicken or something... ohhhh
00:28:00 <sbalmos> that's right up there with root beer BBQ glaze
00:29:00 <zid`> You should try dandelion and burdock
00:30:00 <sbalmos> I don't exactly like the aftertaste of herbicide and insecticide. ;)
00:30:00 <zid`> It's similar to sarsaparilla apparently
00:31:00 <zid`> you mentioned root beer which made me think of it
00:31:00 <zid`> just different roots
00:32:00 <sbalmos> not really sure dandelion is that. had those before in salad. burdock never tried.
00:32:00 <zid`> I've never eaten a danelion, wtf
00:33:00 <zid`> why would you do such a thing
00:33:00 <zid`> I've heard of nettle tea, but eating dandelions, I am fairy sure, makes you some kind of livestock
00:33:00 <zid`> perhaps a kind of grazing ungulate
00:34:00 <sbalmos> pretty good in a field greens salad
00:35:00 <zid`> apparently burdock is what we used before hops
00:35:00 <zid`> to make bitter from
00:35:00 <zid`> and was the inspiration for velcro
00:35:00 <zid`> wikipedia is fun
00:36:00 <sbalmos> huh, interesting
00:37:00 <sbalmos> the whole sarsaparilla mention made me go look back up birch beer
00:37:00 <zid`> also the white goo if you squeeze dandelions is latex
00:39:00 <sbalmos> well it beats eating white Elmer's glue
00:39:00 <sbalmos> :D
00:39:00 <zid`> I assume that's PVA
00:39:00 <zid`> I know how scary americans find chemical names, they avoid them as much as possible
00:40:00 <sbalmos> DHMO, caustic stuff
00:40:00 <zid`> DNA -> heredity juice, PVA -> white glue, etc
00:40:00 <zid`> PVA is great because you can pour it over your skin, wait a bit, then peel it all back off
00:59:00 <mrvn> kazinsal: you can only ungetc() one char on POSIX. Any more is implementation defined.
01:01:00 <mrvn> heat: scanf is perfectly fine if you use %8s and %ms for strings (fixed length or allocate to fit).
01:03:00 <heat> i've never seen %ms before
01:03:00 <heat> is it standard?
01:04:00 <\Test_User> yep
01:04:00 <mrvn> POSIX.1-2008 instead specifies the m modifier for assignment allocation
01:05:00 <zid`> I believe microsoft have been around for a while now heat
01:05:00 <\Test_User> lol
01:06:00 <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.
01:30:00 <heat> "%m[^\n]s"?
01:30:00 <heat> it looks horrible but hey, what can you do
01:30:00 <psykose> for C it looks quite fantastic
01:31:00 <heat> spoken like a true musl libc enjoyer :P
01:31:00 <mrvn> Would be even nicer to get it to return an iovec structure.
01:31:00 <psykose> am i now
01:31:00 <\Test_User> it's short and understandable
01:31:00 <\Test_User> for C++ of similar it'd be extremely long and you'd have to read it 10 times to understand it :P
01:32:00 <mrvn> \Test_User: std::string line; cin.getline(line)?
01:32:00 <\Test_User> mrvn: getline()
01:34:00 <\Test_User> well, fully that'd be char* line; size_t n; getline(&line, &n, stdin);
01:34:00 <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.
01:34:00 <mrvn> \Test_User: that would be far less readable than "%m[^\n]s"
01:35:00 <\Test_User> mrvn: that's the equivilent of your `std::string line; cin.getline(line)`
01:36:00 <\Test_User> only real difference being std::string contains both the char* and size_t
01:37:00 <mrvn> you assertion was that reading a line would be long and unreadable in c++ but getline is really simple.
01:37:00 <mrvn> (unlike in C)
01:38:00 <psykose> they're equally simple and understandable in all of them
01:38:00 <\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');"
01:41:00 <mrvn> I want: auto [a, b, c] = cin >> int >> std::string >> double;
01:41:00 <zid`> The one true C++ way would be to generate a template for every possible format string's argument list
01:41:00 <zid`> then ask the compiler/linker to drop the excessive ones later
01:42:00 <zid`> and this should happen inside every single translation unit
01:42:00 <mrvn> zid`: you mean like ats::format?
01:42:00 <mrvn> std::format
01:43:00 <\Test_User> > "auto [a, b, c] = cin >> int >> std::string >> double;" aaaaaa why, why, why
01:43:00 <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?"
01:43:00 <mrvn> \Test_User: so I don't have to allocate empty objects to read into
01:43:00 <\Test_User> you override the >>, you override the =, and you override the []
01:43:00 <zid`> huge grin ensues
01:44:00 <mrvn> \Test_User: no override for = or [], that's c++ standard
01:44:00 <\Test_User> why don't we override the ; as well while we're at it
01:44:00 <zid`> can you define custom operators yet
01:44:00 <psykose> that's easy, just replace every ; with ,
01:44:00 <zid`> I want a greek question mark operator
01:44:00 <\Test_User> mrvn: you are overriding the =, a, b, c aren't getting returned from cin
01:45:00 <mrvn> \Test_User: and >> is just an example. it would probably have to be more like: cin.get<int, std::string, double>()
01:45:00 <mrvn> can't pass types as argument to operators.
01:46:00 <mrvn> \Test_User: No, that's when you return a std::tuple and unpack it on assignment.
01:46:00 <\Test_User> but cin >> returns cin
01:47:00 <mrvn> not for that use case
01:47:00 <\Test_User> and auto [a, b, c] = cin.get<int, std::string, double>() also looks bad, but at least not as bad as the >>
01:48:00 <mrvn> First you have to make it valid c++, then you can make it look pretty
01:48:00 <\Test_User> ~~or you could just write it in C to start with~~
01:49:00 <mrvn> \Test_User: have you ever tried to write a custom scanf plugin for your structures?
01:50:00 <\Test_User> nope
01:51:00 <mrvn> probably because C doesn't allow it.
01:51:00 <\Test_User> ...what exactly do you mean by scanf plugin for your structures
01:52:00 <\Test_User> on a side note, if C has a standard struct version of C++'s std::string that'd be nice
01:52:00 <mrvn> In ocaml I can say %b (iirc) and then provide a function that reads a struct and returns it.
01:52:00 <\Test_User> eh what
01:52:00 <mrvn> Just like in c++ I can write operator>> for a class.
01:53:00 <\Test_User> I like keeping operators used for their original intention
01:54:00 <\Test_User> even if no one would sanely use that operator in that place anyways, keeping things the same is more readable
01:54:00 <mrvn> It's kind of funny. You could write `let ast = Scanf.scanf "%b" parse_ast` for your C compiler.
01:55:00 <mrvn> Write the whole parser as recursive scanf helper functions.
01:56:00 <\Test_User> ...you're talking about doing what now
01:56:00 <mrvn> that's ocaml syntax
01:56:00 <\Test_User> idk ocaml
01:56:00 <\Test_User> but what's the point of that
01:56:00 <mrvn> Same point as having operator>> defined for your classes
01:58:00 <mrvn> Lets scanf read in arbitrary types.
01:58:00 <\Test_User> so you're talking about changing syntax from a normal function call to some other format
01:58:00 <\Test_User> (normal function call = function(arg1, arg2...);)
01:59:00 <mrvn> \Test_User: in C this would be scanf("%b", fn, &obj); or something.
01:59:00 <\Test_User> ...oh yeah I see what you mean now
01:59:00 <\Test_User> C++'s overloaded functions iirc it's called
01:59:00 <\Test_User> those I wouldn't really oppose having in C, though it is a bit odd
02:00:00 <mrvn> fn would be `const char * (*)(const char *, void *)`
02:00:00 <\Test_User> but redefining the >>/etc operator to do it I dislike
02:00:00 <zid`> https://cdn.discordapp.com/attachments/465586075830845475/987841495786721290/unknown.png
02:00:00 <\Test_User> XD
02:01:00 <mrvn> \Test_User: overloading >> wouldn't even work as the use case has to pass types. Needs to use template parameters for that.
02:01:00 <mrvn> I now c++23 has std::format for printing. Is there also something for scanning input?
02:02:00 <\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
02:04:00 <\Test_User> it's kind of odd but has actual sane usages
02:04:00 <\Test_User> so I don't oppose it
02:05:00 <mrvn> \Test_User: ocaml does it without overloading.
02:06:00 <\Test_User> so ocaml renames it or adds an argument so it's the same function but less efficient when run
02:06:00 <\Test_User> (renames it as in calls it smth other than overloading)
02:07:00 <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.
02:07:00 <\Test_User> ah
02:08:00 <mrvn> bit of syntactic suggar. You can do it fully functional but "format" looks much nicer.
02:08:00 <\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?
02:08:00 <mrvn> \Test_User: yes
02:09:00 <mrvn> And you have partial application: # Scanf.scanf "%d %f";;
02:09:00 <mrvn> - : (int -> float -> '_weak1) -> '_weak1 = <fun>
02:10:00 <mrvn> That's a function taking a `something (*)(int, float)` and returning something
02:10:00 <\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
02:11:00 <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.
02:12:00 <mrvn> I guess you hate "auto" in c++ then
02:13:00 <\Test_User> somewhat
02:13:00 <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.
02:14:00 <\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
02:15:00 <mrvn> you mean foo(&arg), is that calling foo(const bla&) or foo(bla&)?
02:16:00 <\Test_User> I mean you call foo(arg);, but the definition of foo is smth like void foo(int &arg) {arg = 3; return;}
02:17:00 <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
02:17:00 <\Test_User> for languages that are intended with automatic types I'm generally fine with it for stuff I want done quickly
02:17:00 <\Test_User> yeah
02:18:00 <mrvn> and all of them can be present at the same time and you get a different function depending on what arg is.,
02:18:00 <\Test_User> yeah when you combine that with overloaded functions it just turns into a total mess
02:18:00 <mrvn> and don't forget foo(double) can be called as well
02:19:00 <mrvn> implicit conversion is hell
02:19:00 <\Test_User> agreed
02:19:00 <mrvn> \Test_User: how do you multiply 2 uint16_t?
02:20:00 <\Test_User> with assembly >:)
02:20:00 <\Test_User> yes I also hate how C/C++/etc can overflow stuff and not tell you
02:21:00 <mrvn> uint16_t mul16(uint16_t a, uint16_t b) { return a * b; } is UB.
02:21:00 <mrvn> (well, idb)
02:22:00 <\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
02:23:00 <mrvn> uint16_t gets promotes to "int" before the * and then 40000 * 40000 is a signed intreger overflow.
02:23:00 <\Test_User> smth like uint32_t mul16... would however leave more who-knows-what available to happen
02:23:00 <\Test_User> ...what
02:23:00 <\Test_User> aaaa
02:23:00 <mrvn> You have to do return (uint32_t)a * b
02:23:00 <\Test_User> I want a C without implicit conversion :/
02:24:00 <mrvn> But now you compute the upper 16 bit of the multiplication and throw it way. Potentially slower.
02:24:00 <\Test_User> yeah
02:24:00 <mrvn> \Test_User: at least for the integer conversions. There is no way to disable them.
02:25:00 <\Test_User> I mean, conversion of the same base type I'm fine with, conversion of one type to another is bad
02:25:00 <\Test_User> at a minimum I'd want it to ensure unsigned/signed remains
02:26:00 <mrvn> yeah, I don't get that part eigther. Why not fix that? Only thing it would break are the UB cases I believe.
02:27:00 <mrvn> \Test_User: you should watch https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjM_6jKu7j4AhUH_rsIHRPAAnQQtwJ6BAgOEAI&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsBtAGxBh-XI&usg=AOvVaw2oZ4Oo01KS_4IPceWt2rRB
02:27:00 <bslsk05> ​www.google.com <no title>
02:27:00 <mrvn> sorry, https://www.youtube.com/watch?v=sBtAGxBh-XI
02:27:00 <bslsk05> ​'CppCon 2019: Marshall Clow “std::midpoint? How Hard Could it Be?”' by CppCon (01:02:32)
02:28:00 <\Test_User> hour long video lol
02:29:00 <mrvn> and it's all about one trivial function to get the midpoint of a and b.
02:30:00 <mrvn> The author suggested the function to the C++ commite because it's hard to write. First 3 submissions where buggy.
02:30:00 <\Test_User> XD
02:30:00 <mrvn> in asm I just write "(a + b) / 2"
02:31:00 <\Test_User> (a + b) >> 1, no division needed
02:31:00 <\Test_User> unless you want floats... yeah nvm
02:32:00 <mrvn> you have to pick asr or lsr to match the type though
02:32:00 <\Test_User> actually not sure how floats do with bitwise shifts...
02:32:00 <mrvn> but really I only need this for array indexes to uintptr_t it is.
02:33:00 <mrvn> \Test_User: no bitwise shift for float regs.
02:33:00 <\Test_User> k
02:33:00 <\Test_User> makes sense
02:34:00 <mrvn> shifting floats: Do you know: https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code
02:34:00 <bslsk05> ​en.wikipedia.org: Fast inverse square root - Wikipedia
02:35:00 <\Test_User> lol what-
02:36:00 <mrvn> Indeed. when you read that code the first time it realy is a WTF moment.
02:42:00 <zid`> Good news, the birds are happy, it's sunrise
02:42:00 <zid`> that must mean it's 3:30am
02:43:00 <\Test_User> sunrise at 3:30 seems quite early, where does the sun set for you
02:44:00 <zid`> In the sky, usually
02:44:00 <\Test_User> *when
02:44:00 <\Test_User> lol
02:44:00 <zid`> 21:19
02:44:00 <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
02:44:00 <\Test_User> sounds like a pain sleeping in summer
02:45:00 <zid`> It's lovely
02:45:00 <zid`> can have a picnic outside at 2am
02:45:00 <\Test_User> nice
02:46:00 <zid`> https://www.webcamtaxi.com/en/england/cambridgeshire-county/wansfordstation-nene-valley-railway.html
02:46:00 <bslsk05> ​www.webcamtaxi.com: Access denied | www.webcamtaxi.com used Cloudflare to restrict access
02:47:00 <zid`> https://www.timeanddate.com/sun/uk/london graph
02:47:00 <bslsk05> ​www.timeanddate.com: Sunrise and sunset times in London
02:47:00 <zid`> Night:
02:47:00 <zid`> Not for this day
02:48:00 <mrvn> chirping has started,
03:02:00 <\Test_User> > signed integer overslow is undefined, unsigned is defined
03:02:00 <\Test_User> wait what
03:02:00 <\Test_User> *overflow
03:03:00 <\Test_User> how is signed not defined
03:03:00 <zid`> because different arches do different things, so it'd cripple whatever arch that is to have to do what the others do
03:03:00 <zid`> C being portable-80s-assembler
03:03:00 <\Test_User> ahhhh yes true, the different ways of handling negative numbers
03:04:00 <zid`> right, so all the one's comp machines would need if(overflow) adjust(); after every signed add
03:04:00 <\Test_User> I always just think of the modern way it's done
03:04:00 <zid`> or you just say overflow is UB and skip them all
03:04:00 <\Test_User> yeah
04:23:00 <sonny> Does anyone know why windows subsystems are called personalities?
04:29:00 <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.
04:30:00 <mrvn> sonny: because they are called personalities on unix
04:30:00 <sonny> unix doesn't have subsystems
04:32:00 <mrvn> sonny: 64bit linux has the 32bit personality and 32bit int/pointer + 64bit long personalities. BSD has a linux personality.
04:33:00 <mrvn> man personality
04:33:00 <sonny> ok, that's cool I didn't know there was a linux thing for BSD
04:34:00 <moon-child> freebsd has a linux _emulator_
04:34:00 <mrvn> sonny: there is a debian for bsd
04:34:00 <moon-child> mrvn: that's different
04:34:00 <moon-child> afaik
04:34:00 <moon-child> not using the linux kernel emulation, but compiling debian userland for the freebsd kernel
04:34:00 <mrvn> Nope, that runs linux code in the linux personality of freebsd. it's not emulation.
04:34:00 <sonny> mrvn what bsd manual? I just checked freebsd but I did not see anything
04:35:00 <mrvn> sonny: it's a linux manpage
04:35:00 <moon-child> mrvn: it's literally called the linuxulator
04:35:00 <sonny> oh
04:36:00 <sonny> mrvn: "personality - set the process execution domain" -- this?
04:36:00 <mrvn> moon-child: debian kfreebsd is between porting to BSD and linuxulator
04:37:00 <mrvn> sonny: and similat other tools and manpages
04:39:00 <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
04:39:00 <sonny> s/windows/microsoft/
04:39:00 <mrvn> leading to some nice kernel exploits
04:39:00 <mrvn> NT used to be a microkernel
04:40:00 <sonny> yeah, seems so
04:40:00 <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.
04:40:00 <sonny> at least before NT 4
04:40:00 <Affliction> Didn't 9x run parts of IE in the kernel too?
04:40:00 <Affliction> What could possibly go right
04:40:00 <sonny> o.O
04:41:00 <mrvn> 9x was a monolithic design
04:41:00 <sonny> is that why you can't uninstall it? lol
04:41:00 <Affliction> sonny: Nah, I think that's because trident (its rendering engine) was embeddable, and was used all over the place.
04:41:00 <sonny> oh
04:42:00 <sonny> so much for seperation
04:43:00 <sonny> is posix an abi?
04:45:00 <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
04:48:00 * moon-child hands sonny a fork
04:48:00 <sonny> oh
04:48:00 <sonny> right
04:51:00 <moon-child> (although. cygwin and midipix)
04:52:00 <moon-child> (midipix has a fork, right? I know cygwin does)
04:52:00 <sonny> I thought midipix was wip
05:46:00 <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.
05:46:00 <mrvn> Windows was POSIX certified, Linux isn't.
05:47:00 <mrvn> Although in Windows they only implemented the bare essentials, none of the optional stuff that makes it actually usable. But it was certified.
05:51:00 <sonny> I thought they got some third party thing from someone else
05:51:00 <sonny> I don't recall it being certified either
14:03:00 <gog> mew
15:03:00 <GeDaMo> https://rowrrbazzle.blogspot.com/2016/06/answer-by-fredric-brown-full-short.html
15:03:00 <bslsk05> ​rowrrbazzle.blogspot.com: Perkin Worbeck's Magic Newt: "Answer" by Fredric Brown (1954) (complete short-short story)
15:06:00 <zid`> Anyone who failed to help in creating it was then turned to stone
15:07:00 <GeDaMo> https://rationalwiki.org/wiki/Roko%27s_basilisk
15:07:00 <bslsk05> ​rationalwiki.org: Roko's basilisk - RationalWiki
15:12:00 <zid`> Today is the hottest 18C ever wat
15:13:00 <GeDaMo> https://en.wikipedia.org/wiki/Wet-bulb_temperature#Wet-bulb_temperature_and_health
15:13:00 <bslsk05> ​en.wikipedia.org: Wet-bulb temperature - Wikipedia
15:13:00 <zid`> dew point 10.3, 60% humidity, 1015mb pressure
15:13:00 <zid`> 3300 feet clouds
15:24:00 <Andrew> Maybe I should implement a syscall that "writes the current weather for location [ebx] into [eax]"
15:24:00 <Andrew> Weather is important
15:24:00 <Andrew> (just kidding)
15:25:00 <zid`> you should be kidding, what if I want more than 4GB of weather
15:28:00 <mrvn> pointers are passsed in A0.
15:28:00 <mrvn> and A1
15:46:00 <gog> you should just have a server that listens for messages of type get_weather
15:47:00 <gog> the system call does nothing but copy the message from the broadcaster to the listener
16:06:00 * kingoffrance favors fuzzy weather like fuzzy clock "mid xth century" this would be like "getting warmer"
17:05:00 <ddevault> what are the low bits in segment registers for?
17:06:00 <GeDaMo> Low bits?
17:07:00 <ddevault> for instance, my ss for userspace is 0x10 but it comes into the ISR as 0x1b
17:08:00 <weinholt> that would probably be the priviledge level of the descriptor (like in the sense of CPL=3)
17:09:00 * ddevault shrugs and OR's them with the values from the CPU
17:11:00 <j`ey> ddevault: whats nullable do if normal pointers can be null anyway?
17:11:00 <ddevault> normal pointers can only be null if you cast null to that pointer type
17:11:00 <ddevault> and casting is essentially telling the type system you know better
17:13:00 <ddevault> anyway, ta-da: https://a.uguu.se/uzLWdMrN.jpg
17:13:00 <liz> ddevault: nice thinkpad, and nice task switching too
17:14:00 <ddevault> thanks, thanks
17:17:00 <j`ey> ABABABAB
17:29:00 <ddevault> I'm thinking about doing context switching by setting the IST for the PIT to the thread's context struct
17:30:00 <ddevault> then the ISR pushes all of the registers there and switches to the kernel stack (non-preemptable kernel)
17:30:00 <ddevault> saves me copying the context later
17:30:00 <ddevault> any obvious drawbacks to this approach?
17:42:00 <mrvn> all the parts where you context switch not in the timer
17:42:00 <ddevault> these could fall back to the manual approach
17:42:00 <ddevault> but I'm not sure there will be many of those
17:46:00 <mrvn> it will be more than 0
17:46:00 <ddevault> examples?
17:46:00 <mrvn> sleep
17:46:00 <mrvn> yield
17:46:00 <mrvn> read
17:46:00 <ddevault> this is a micro-kernel, so no read
17:47:00 <ddevault> but yeah, during some syscalls it would make sense to switch contexts
17:47:00 <ddevault> I mean, I could also set the syscall stack to the current thread's state
17:48:00 <gog> a context switch will always happen during your message passing syscalls
17:49:00 <ddevault> right, but couldn't the syscall handler do something similar
17:49:00 <mrvn> gog: only if you care about performance
17:49:00 <mrvn> ddevault: now you have 2 places that context switch
17:49:00 <mrvn> fork and exit are 2 more
17:50:00 <ddevault> those are just syscalls, so no additional places
17:50:00 <mrvn> it realy makes more sense to have code to have a switch_thread function you can call from anywhere in the kernel
17:50:00 <ddevault> you can - it just updates the active thread's arch context pointer
17:50:00 <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
17:51:00 <mrvn> ddevault: not the way you described your kernel stack
17:51:00 <ddevault> syscall/isr stack is set to the thread's arch state
17:51:00 <ddevault> syscall/interrupt handler pushes all of the registers there and sets %rsp to kernel_stack_top and proceeds
17:51:00 <ddevault> then the clean-up code sets %rsp to the current task's arch context and pops everything back off
17:52:00 <ddevault> am I missing something?
17:52:00 <mrvn> ahh, now I get it.
17:53:00 <mrvn> You don't have a per task kernel stack at all.
17:53:00 <ddevault> nope
17:53:00 <ddevault> one stack per CPU
17:53:00 <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.
17:54:00 <ddevault> oh
17:54:00 <ddevault> great :)
17:55:00 <mrvn> You might add reloading the page tables to that. Have kernel page table switching for some side channel mitigation.
17:55:00 <ddevault> not sure
17:56:00 <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)
17:56:00 <ddevault> kernel page tables*
17:56:00 <ddevault> but yeah, I will research that, and other hardening steps, in one fell swoop
17:56:00 <ddevault> right now it's quite easy to crash the kernel
17:56:00 <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.
17:56:00 <ddevault> there is no kernel thread
17:57:00 <mrvn> I'm saying make one
17:57:00 <ddevault> I mean
17:57:00 <ddevault> what is a thread if not something with CPU time and a stack
17:57:00 <mrvn> It has a stack, a page table, VM structures, ...
17:57:00 * ddevault shrugs
17:57:00 <ddevault> semantics
18:01:00 <ddevault> I suppose I could work with a fixed number of page tables and just reshuffle them to access different parts of memory
18:02:00 <ddevault> not sure it would be efficient, though
19:33:00 <FatAlbert> where is he
19:33:00 <FatAlbert> gog: maw
19:34:00 <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
19:36:00 <FatAlbert> yeah im broke .. but i know ill do good oen day
19:36:00 <FatAlbert> i know it
22:24:00 <ddevault> actually putting that TSS idea into practice was... difficult
22:27:00 <ddevault> now my kernel does the same thing, but better(TM)
22:47:00 <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)
22:48:00 <clever> you can route it to a socket, tty, or fifo
22:50:00 <klange> yeah, run it in screen :smugsipemoteasifthiswasdiscord:
22:52:00 <\Test_User> you can use unicode emojis on IRC
22:53:00 <j`ey> clever: whats the syntax for a tty?
22:54:00 <klange> You probably don't want the tty approach if you want to connect from screen; that's for an _existing_ tty.
22:56:00 <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
22:56:00 <clever> j`ey: probably starting in https://www.qemu.org/docs/master/system/invocation.html#hxtool-6
22:56:00 <bslsk05> ​www.qemu.org: Invocation — QEMU documentation
22:57:00 <clever> -chardev pty,id=id there it is
22:57:00 <clever> it creates a pty on the host, much like sshd/xterm do
22:57:00 <klange> `-serial` takes a device description as an argument, you don't want -chardev
22:57:00 <klange> You probably just want `-serial /dev/ttyAMA0` tbh
22:57:00 <clever> yeah, i expect -serial pty ti also work
22:57:00 <clever> klange: that would expose the real serial port to the guest
22:58:00 <j`ey> I want to expose the guest's serial port to the host
22:58:00 <klange> Is that not what j`ey asked for?
22:58:00 <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?
22:58:00 <j`ey> ^
22:58:00 <clever> yeah, `-serial pty` is also a valid option
22:59:00 <j`ey> thanks I will try that
23:01:00 <clever> it will be something like /dev/pts/42
23:01:00 <clever> and then you can open it like any other tty and talk to the guest
23:01:00 <klange> (and it'll print the allocated pty path on startup)
23:02:00 <j`ey> yes thanks, that works!
23:09:00 <gog> mew
23:09:00 <FatAlbert> i hear you
23:09:00 <heat> mewtwo
23:10:00 <FatAlbert> j`ey j`ey laroche