Search logs:

channel logs for 2004 - 2010 are archived at ·· 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

Thursday, 16 June 2022

00:19:00 <gog`> mew
00:33:00 * moon-child pets god
00:38:00 <heat> sup gog
00:38:00 <gog> chilling, writing some experimental codes
00:39:00 <gog> hbu?
00:56:00 <klange> All of my code is experimental, in so far as I have no idea if it will work until I try it.
00:56:00 <zid`> Yea I'm about to start one of those myself and erm
00:57:00 <zid`> it's a lot of work to get to the point where it will fail
00:57:00 <zid`> so I'm kind of avoiding it
01:07:00 <heat> gog, i feel overwhelmed with work so I've just spent the last hour doing nothing
01:08:00 <gog> mood
01:08:00 <gog> i have an 11 hour shift tomorrow
01:08:00 <heat> i have uni work + exam friday, and i'm balancing my dayjob and this
01:08:00 <gog> after a 10 yesterday and today
01:08:00 <gog> oof yeah
01:08:00 <heat> and i'm struggling a bit rn bcuz it's my first job and all that
01:08:00 * gog offers hugs
01:08:00 <heat> i need to get in the rythm
01:09:00 * heat hugs back
01:09:00 <heat> 10h is a bit too much no?
01:09:00 <mjg_> uni?
01:09:00 <mjg_> how old are you
01:09:00 <heat> 19
01:09:00 <mjg_> nice
01:09:00 <lainon> I feel you on balancing school and work. Working my first full-time job and working on my master's.
01:10:00 <mjg_> i was in position to "balance" and ended up dropping out
01:10:00 <gog> yeah they scheduled me a lot of overtime this week because we're still understaffed despite hiring 5 new people in the last couple weeks
01:10:00 <mjg_> time flies faster than you think, i'm sayin
01:10:00 <heat> gog, cloudflare is hiring ;)
01:11:00 <gog> i may have another interview with marel coming up+
01:11:00 <heat> and we actually do full remote, even on *any* country sometimes
01:11:00 <gog> they need a c++ coder who knows about qt
01:11:00 <gog> which is me
01:11:00 <zid`> Do they need many C firmware programmers
01:11:00 <gog> maybe
01:11:00 <gog> do you have experience with PLCs?
01:12:00 <zid`> I love public limited companies!
01:12:00 <heat> lol
01:12:00 <gog> the other kind of plc
01:12:00 <zid`> oh, not really, I wouldn't really consider them to be firmwarey
01:12:00 <zid`> ladder logic and crap bleh
01:12:00 <gog> true
01:13:00 <zid`> hmm I need an oldish skidrow unpacker before they swapped to whatever this one is that needs w10
01:13:00 <heat> piracy bad
01:13:00 <heat> rust... good?
01:14:00 <zid`> stub dll makes it run but it doesn't function :(
01:14:00 <heat> anyway, this may interest some people around here:
01:14:00 <bslsk05> ​twitter: <majek04> Are you a student? ␤ ␤ Do you like to hack on Linux kernel networking stack? ␤ ␤ We're looking for (paid) interns during this summer holidays! You'll do public kernel work, under supervision of our elite Linux team! ␤ ␤ (seriously, we're looking for summer interns at Cloudflare)
01:15:00 <heat> cc gog I guess
01:15:00 <zid`> okay it *does* work with the stub, just incorrectly, some path seps are gone and no pgoress bar etc
01:15:00 <zid`> but I can fix that
01:16:00 <zid`> Program Files (x86)Games best dir name
01:17:00 <heat> why are you pirating a video game and how does it tie in to a childhood trauma
01:18:00 <zid`> poverty
01:18:00 <zid`> to both
01:22:00 <sbalmos> it's not childhood trauma unless it involved hours of fooling with CONFIG.SYS and HIMEM.SYS
01:22:00 <Jari--> well first pirate, and then later when you have the means, you buy the games
02:10:00 <dasabhi> hello i was wondering, if a shared library is calling a /dev character file that maps to a kernel mod, do multithreaded calls to said driver with ioctl get queueded by default?
02:11:00 <dasabhi> as in if two threads call fd=open(/dev/w.e) an ioctl(fd)
02:11:00 <dasabhi> with their own fds
02:11:00 <dasabhi> is this undefined behaviour land? :S
02:12:00 <dasabhi> or is it the shared library's job to make sure only one can call the ioctl
02:12:00 <dasabhi> with some kind of mutex lock
02:13:00 <heat> dasabhi, that's the kernel's problem
02:13:00 <dasabhi> ahh okay
02:13:00 <heat> the ioctl can work completely lockless, or it may need a lock, or it can use a more complex solution (RCU, epoch, etc)
02:14:00 <dasabhi> so the library just needs to have different fds for the different threads, and call it a day
02:14:00 <heat> no
02:14:00 <zid`> If you could break the kernel by doing the right sequence of open() calls I'd be very unhappy
02:14:00 <heat> it can use the same fd
02:14:00 <zid`> (depending on what that device actually does, that might be completely mandatory, or utterly insane)
02:14:00 <dasabhi> heat: even if this character driver is sending shit to an actual device for processing for me?
02:15:00 <heat> yup
02:15:00 <zid`> A character device would be closer to the "Insane" side, to open multiple times and spam with writes from multiple threads :P
02:15:00 <heat> see: /dev/tty
02:15:00 <dasabhi> damn all the threads can share the same fd and bang the same ioctl and its all the kernels problem
02:15:00 <zid`> but there are very valid cases for that
02:15:00 <heat> dasabhi, yes
02:16:00 <heat> it's totally the kernel's problem because it's a security problem
02:16:00 <heat> a DoS by banging an ioctl from two threads without locking in userspace is stupid
02:16:00 <heat> the kernel can't *enforce* you're locking, so it can't protect the system from you
02:16:00 <heat> therefore, it's the kernel's problem
02:16:00 <zid`> /dev/null not being openable by more than 1 process would be funny though
02:17:00 <heat> or tty lol
02:17:00 <zid`> EAGAIN
02:19:00 <dasabhi> so considering the design of this shared library, I would want to implement a lock and make sure, only one thread can use the fd and call ioctl only one at a time yeah?
02:20:00 <heat> no
02:20:00 <heat> again, it's the kernel's problem
02:20:00 <heat> the only reason why you'd want a lock would be if you want to stop interleaved operations on that fd
02:21:00 <heat> but that's not something you usually need or want
02:22:00 <dasabhi> okay that makes a lot of sense
02:22:00 <dasabhi> ty
02:23:00 <heat> a problem you may want to tackle in userspace is fd refcounting though
02:23:00 <heat> sharing fd's between threads isn't that trivial because frequently you can accidentally close() it on one thread
02:24:00 <heat> if another part of the program opens a new file, and the other thread accidentally writes to it - oops
02:24:00 <heat> Google made fdsan to try to find those issues
02:25:00 <dasabhi> yeah i am thinking i just make a new fd for each thread that wants to talk to this character device
02:26:00 <dasabhi> and then make close/delete function in my api for the user to shutdown the specific fd they opened
02:26:00 <dasabhi> i did consider that issue
02:26:00 <dasabhi> having one fd means different threads could close it yeah :/
02:27:00 <heat> have a refcount
02:27:00 <heat> if the character device isn't seekable/you aren't seeking, that should work
02:28:00 <dasabhi> that works too
03:15:00 <geist> doug16k: did you get your esp32 back up?
03:15:00 <geist> also, you know, i just noticed you're back. when did you sneak back? you were out for a long time there
03:16:00 <geist> looks like first time in a while is last saturday?
03:43:00 <doug16k> yes for almost a year. I just received the first few esp32 today
03:45:00 <doug16k> correct
04:11:00 <doug16k> binutils killed my project
04:11:00 <doug16k> must be short for garbagebin utils
04:12:00 <doug16k> I thought it was binary for a long time
04:12:00 <zid`> I just banned you from ##binutils
04:12:00 <zid`> (I didn't really)
04:12:00 <doug16k> no matter what I did, the first section had 0 VMA
04:13:00 <doug16k> in uefi
04:13:00 <zid`> PE BFD is no good? surprising ;)
04:13:00 <doug16k> some idiotic change for windows to enforce things above 4GB for better address randomization entropy
04:14:00 <zid`> isn't that vaguely how ASLR always works?
04:14:00 <zid`> you leave the VMA as 0
04:14:00 <zid`> and make a shared object
04:15:00 <doug16k> windows has a "preferred load address" where it is already linked at some address
04:15:00 <doug16k> and relocations to fix it
04:15:00 <zid`> yea usually 0x4001000 or something?
04:15:00 <zid`> one fewer 0 after the 4
04:15:00 <doug16k> traditionally it was 0x400000 yeah, plus the header offset you mentined, sure
04:17:00 <doug16k> I realized, I should just stop using the PE linker altogether, and make a little tool that extracts sections from an ELF and make a PE COFF from it
04:18:00 <doug16k> I made a tool like that ages ago, to make win32 programs from djgpp, before mingw existed
04:19:00 <zid`> yea I did the same thing when I was hacking a game to shit
04:19:00 <zid`> then realized I could do it in a much less silly way
04:21:00 <doug16k> it's extra easy to do it for UEFI, there are no imports or exports
04:21:00 <doug16k> no resources
04:22:00 <doug16k> the only part that is nontrivial is the relocations
04:23:00 <kazinsal> yeah I've had to deal with a bunch of funky DLL preferred load address stuff before
04:25:00 <zid`> I wanted to link something to an exe permanently
04:25:00 <zid`> so I wrote a thing to relocate two things together and write out a new binary
04:25:00 <zid`> which required moving rdata around so that it'd even fit and stuff
04:25:00 <zid`> then I switched to just patching the entry point to be push "zid.dll"; call main instead, 100x easier :p
04:26:00 <zid`> (I didn't wanna use an external loader)
04:27:00 <kazinsal> fun awful fact: GetModuleHandle actually just returns the base address of the DLL you're asking about. that's all an HMODULE is
04:27:00 <zid`> yea
04:27:00 <zid`> I've used that fact for nefarious purposes before
04:29:00 <kazinsal> I have written a lot of brilliantly awful code that fixes bugs in with GetModuleHandle("some_badly_written_game_engine_part.dll") and wrappers for VirtualProtectEx and WriteProcessMemory to inject machine code
04:29:00 <zid`> Did I ever show you my PATCH ENGINE
04:29:00 <kazinsal> oh dear
04:30:00 <doug16k> most fun code injection is CreateRemoteThread with start address at LoadLibrary, VirtualAllocEx memory for a string, WriteProcessMemory the string, set rdi to that address
04:30:00 <doug16k> which is the thread param
04:30:00 <zid`>
04:30:00 <bslsk05> ​ patch.c · GitHub
04:30:00 <doug16k> then in the DllMain have your fun
04:30:00 <zid`> yea that's a classic
04:31:00 <zid`> LoadLibrary happening to match the sig of a new thread so you can use it to inject code's probably the most famous weird quirk evre
04:32:00 <zid`> kazinsal: That's the dll I inject
04:33:00 <zid`> I link that to a big array of patches, and a bunch of .o files implementing the patches, gg
04:33:00 <zid`> it opens an ini to check if the patches should be enabled or not
04:43:00 <dasabhi> btw when you open a character device file with open i am guessing the r and w macro doesnt matter right?
04:44:00 <zid`> why wouldn't it?
04:44:00 <zid`> just because you don't read it in blocks it's not allowed to be read only!?
04:44:00 <zid`> racism imo
04:45:00 <dasabhi> :(
04:45:00 <dasabhi> how exactly do you read and write a kernel module lmao
04:45:00 <kazinsal> very carefully
04:47:00 <zid`> what if it's a rom
04:49:00 <kazinsal> then if it's opened with "w" you get nice and close up to the user's ear so they can feel your breath tickling their cochlea and with the parasocial faux enthusiasm of an asmr youtuber you whisper "undefined behaviour~"
04:50:00 <zid`> kazinsal: did you like my silly PATCH ENGINE then?
04:50:00 <kazinsal> yeah it reminds me of some awful things I've done in prod
04:51:00 <zid`> This is the hyper clean version
04:51:00 <zid`> compared to huge lists of ifs() and *((int *)0x33341232) = 3;s
04:51:00 <kazinsal> yeah
04:54:00 <dasabhi> kazinsal: that was waaaaaay too specific
04:54:00 <dasabhi> now i need kernel programming asmr
04:54:00 <kazinsal> that is in fact the method by which I impart wisdom here
05:02:00 <stephe> hi
09:22:00 <Jari--> hi all
09:38:00 <zid`> omgomgomgomg
09:39:00 <zid`> zachtronics' new game is listed on steam and it's.. exactly what I've always wanted
09:39:00 <zid`> engineer of the people remake in not-flash
10:47:00 <kazinsal> zachtronics' new game reminds me that I keep meaning to put together a bbs on the vax but I never get around to doing it
10:48:00 <kazinsal> could be kinda fun to hook up a sip trunk to it through a cisco box so that people can dial into the bbs
12:57:00 <Jari--> Tachyum unveils a monster processor that does everything :: The wait is finally over and the US-startup Tachyum has now launched its Prodigy universal processor which combines the functionality of a CPU, GPU and TPU in a single processor. ::
12:57:00 <bslsk05> ​ Tachyum unveils a monster processor that does everything - Wilson's Media
13:03:00 <Jari--> Next Bill Gates, Elon Musk will be who will make the first sentient A.I. personallity.
13:03:00 <Jari--> DoD Pentagon wants bombers with "literacy skills."
13:06:00 <Jari-->
13:06:00 <bslsk05> ​ DoD must innovate in AI by 2025 - Military Embedded Systems
13:06:00 <Jari--> In case if you are interested.
13:10:00 <Jari--> Today, 100s of billions of dollars in private capital have been invested in 1,000s of AI startups. The U.S.
13:10:00 <Jari--> I am going to Google this.
13:58:00 <heat> don't google
13:58:00 <heat> bing it
13:58:00 <GeDaMo> quack quack
13:59:00 <heat> bing is based
14:21:00 <Jari--> play some Quacke
14:21:00 <Jari--> nullmodems anyone?
14:22:00 <Jari--> "AI ML" jobs, am I with down-to-earth people if I apply?
14:23:00 <Mutabah> Nowadays, probably
14:27:00 <heat> you may end up thinking the AI you're building became sentient
14:27:00 <Mutabah> Just don't make a chatbot, problem solved
14:33:00 <heat> that's great advice
14:33:00 <heat> every chatbot becomes racist at some point
14:33:00 <heat> either that or pseudo-sentient
14:34:00 <heat> so you're getting fired either way
14:34:00 <Jari--> Well, and its humans after all that will use it. Meaning you have to know the psychology of your clients. Mathematical equations is not all.
14:34:00 <Jari--> It would be already an A.I. if you could automate and make a Pro-Trump news engine.
14:35:00 <Jari--> But this is where I lost the track.
14:35:00 <Jari--> I mean, it is fundamentally important, that human will train the system.
14:37:00 <Jari--> Google has still leftovers, things to do, for me to get my liking news on - actually at the beginning it is not very easy, you fail, fail. Etc. But if you add recommendations, like the Google search gives by your searches, it would work, equally as good as - with a team of workers, say thousand at least worked on ... Don't expect me to do it myself.
14:38:00 <muffin> I am reading a book about consciousness, it is called "The origin of consciousness in the breakdown of the bicameral mind". oversimplified it says that consciousness is more of a habit than a fundamental thing. sentience though... I think machines are sentient to be honest.
14:38:00 <Jari--> muffin: I am personally interested in learning more about the human, animal senses. How does it work in mathematical equations excels and so on.
14:39:00 <Jari--> So how does it make it so quickly available to the person, the senses, all data gatthered, also a todo.
14:40:00 <Jari--> muffin: sounds your book might be a bit psychological on it's approach. I am looking for very simple equations, explanations I mean, how to sort out, for example web pages.
14:41:00 <muffin> I have to first understand the variables before I try to calculate it
14:41:00 <Jari--> Philosophical books lots, practical answers not many.
14:42:00 <Jari--> muffin: yeah, it is great if you are at marketing
14:43:00 <Jari--> I understand Google as having multiple senses, it feels something definitely on mathematical, programming level. Imagine if the file disposery, a folder, of images on Google would be human brains. And it sorts out it for searching. Practically I mean when we think we are basically searching the database in our brains. Interconnected with the senses.
14:44:00 <Jari--> But a man without senses would be really dull company.
14:44:00 <muffin> well, that's where the book would help you out. because basically it says that one approach to understand consciousness and sentience is to think of it as an epiphonomenon
14:45:00 <muffin> s/epiphonomenon/epiphenomenon/
14:45:00 <Jari--> epiphenomenon? aliasing
14:45:00 <Jari--> yeah
14:45:00 <Jari--> its a phenonemon
14:46:00 <muffin> so, that's a big thing that differenciates us from computers
14:46:00 <Jari--> yes
14:47:00 <Jari--> Google might do it for marketing reasons, to study how we spend our money, or what do we like or what do we dislike. But after all, this is also very important for the A.I. development to know, it has pre-rendered sense database available indefinitely, to mimic a human being.
14:47:00 <Jari--> And its not purely economics it has data on us.
14:48:00 <Jari--> muffin: wondering how many years until Google can keep up more memory than a 100 year old has even experiences? a sense database.
14:49:00 <Jari--> Relative amount of practical useful data.
14:50:00 <Jari--> Mathematically it is larger, but how much pre-rendered data it has, more sophisticated, than our human brains.
14:50:00 <Jari--> To build an AI, and do the AIML favourite job it seems today. Spam! On employment office.
14:52:00 <Jari--> muffin: have you noticed how one AIML job for example, has 20, sometimes 30, maybe even 50 jobs positions on subcontractors.
14:52:00 <muffin> idk man, I never had an interest for office politics
14:53:00 <muffin> I was always for the focused on the actual work person
14:53:00 <muffin> s/for/more
14:55:00 <Jari--> A.I. gurus are leaving Big Tech to work on buzzy new start-ups
14:55:00 <bslsk05> ​ A.I. gurus are leaving Big Tech to work on buzzy new start-ups
14:55:00 <Jari--> muffin: interesting times
14:56:00 <Jari--> Some companies you would like to consider send a CV to:
15:02:00 <Jari--> Semantic Intelligence
15:02:00 <Jari--> Simply put, semantic analysis is the process of drawing meaning from text. It allows computers to understand and interpret sentences, paragraphs, or whole documents, by analyzing their grammatical structure, and identifying relationships between individual words in a particular context.12 Aug 2020
15:03:00 <Jari--> This is what I am doing.
15:04:00 <Jari--> Semantics within psychology is the study of how meaning is stored in the mind. Semantic memory is a type of long-term declarative memory that refers to facts or ideas which are not immediately drawn from personal experience.
15:04:00 <Jari--> Conclusionary?
15:24:00 <heat> why is big tech not in your graph
15:24:00 <Jari--> :)
15:25:00 <heat> oh
15:25:00 <heat> these are just startups
16:34:00 <mrvn> "Four of the best-funded new AI start-ups — Inflection, Cohere, Adept and Anthropic — have recently poached dozens of AI scientists with backgrounds in Big Tech." You have a startup, you given tons and tons and tons of money and then you expect them to hire stupid people?
18:48:00 <sonny> Are the most recent 'novel' operating systems genode and plan9?
18:49:00 <geist> guess it depends on your definitino of novel
18:49:00 <sonny> The more I study bsd, NT, linux the less sure I am of what I would do differently
18:49:00 <sbalmos> ... was about to say the same thing
18:50:00 <j`ey> fuchsia?
18:50:00 <sbalmos> capability-based
18:50:00 <sbalmos> seL4 ?
18:50:00 <sonny> well, it seems that capabilites don't work in the real world for some reason
18:50:00 <geist> why do you say that?
18:50:00 <sonny> seL4 is the verified kernel?
18:51:00 <geist> i'd like to say the fuchsia kernel, zircon, has a pretty usable capability system
18:51:00 <sonny> geist: it seems the the fine grain access it gives makes it less convient to work with
18:51:00 <sonny> ok, I should start looking at fuschia then
18:52:00 <geist> tis true, also DOS is more 'convenient' than linux, because you can just directly mess with hardware
18:52:00 <geist> my point is convenience is fairly subjective, but tends to be a continuum that you have to consider
18:52:00 <sonny> yeah, looks like finding the right balance is tricky
18:52:00 <sonny> capability projects for unix don't seem to be popular
18:53:00 <sonny> what I mean by that is, there's been a few done, but they don't get used
18:53:00 <sbalmos> "novel" and "popular" don't seem to go together
18:53:00 <sbalmos> by that definition
18:53:00 <geist> well that's true, it may just be that posix + capability is fundamentally difficult to pull off cleanly. i haven't thoght about it much
18:53:00 <sonny> sbalmos this is a different topic
18:54:00 <sonny> geist well if we consider a file descriptor a capability, then it worked for a while I guess
18:54:00 <sbalmos> an FD is a handle
18:54:00 <geist> right, but there's still a fair amount of 'ambient authority' in the posix model
18:54:00 <geist> like the fact that you can try to open a file, or create a process or allocate memory, or create a thread, etc
18:54:00 <sbalmos> POSIX "capabilities" are more like the u,g,o+rwxa rights triples, even then it's a stretch
18:55:00 <geist> that's what zircon at least tries to do. for the most part (with some unforunate exceptions) you have to have a handle to something to make a new thing
18:55:00 <sonny> geist yeah, it seems like industry opted to virtualize instead
18:56:00 <sonny> I do wonder how to make systems that don't require the virtualization hack to protect resources
18:56:00 <sonny> sharing is the other big deal, computers are everywhere now
18:56:00 <GeDaMo> What are you protecting them from?
18:57:00 <sonny> in general 'bad actors', but I guess I could just say processes
18:57:00 <GeDaMo> Don't allow running processes, problem solved! :P
18:57:00 <sonny> lol
18:58:00 <sonny> ultimate system, never fails
18:58:00 <GeDaMo> There always seems to be some security hole if you allow running arbitrary programs
18:58:00 <geist> dont have processes: DOS. then run it in a virtual box
18:58:00 <geist> then dont let it interact with anything
18:59:00 <geist> also force it to stay in real mode. protected mode is where things get bad
18:59:00 <geist> no emm386.sys for you
18:59:00 <sonny> I'm noticing a trend :P
18:59:00 <GeDaMo>
18:59:00 <bslsk05> ​ A new vulnerability in Intel and AMD CPUs lets hackers steal encryption keys | Ars Technica
18:59:00 <GeDaMo> "Hertzbleed attack targets power-conservation feature found on virtually all modern CPUs"
18:59:00 <geist> yeah i saw that. >.<
18:59:00 <sonny> oh, another side channel attack
19:00:00 <mrvn> If you make a VM per app then the app needs no memroy protection, no capabilities, nothing. The VM though then does.
19:01:00 <mrvn> GeDaMo: That page won't let me scroll
19:02:00 <GeDaMo> It works for me but I have JS disabled :P
19:02:00 <sonny> what a find, these researchers must be very creative
19:03:00 <sonny> In a distributed OS, it seems that the emphasis is placed on the protocol design, and it's use throughout the system. Is there another major aspect?
19:04:00 <mrvn> How can that work at all? For there to be any frequency scaling or volatge changes the code has to do different computations for 0 and 1 bits. That's near certain already means a timing attack.
19:05:00 <mrvn> So at best I would say they found a new way to measure already vulnerable code.
19:05:00 <heat> apparently not
19:13:00 <mrvn> Usulay modern crypto is written to fully compute both cases and only at the last second pick the one actually needed. Is the pipelining going to kill some of the computation when it reaches the final "cmov" and sees one of them gets discarded and thereby change the power requirement?
19:13:00 <mrvn> both cases of a 0 or 1 bit in a key
19:16:00 <heat> cloudflare's shit is FIPS certified and even we got fucking pwned
19:16:00 <heat> it's not a "incompetent devs" problem
19:16:00 <mrvn> YOu've seen this exploit in the wild?
19:17:00 <heat> they had a POC
19:17:00 <heat> you should read the whitepaper
19:17:00 <heat> they fully extracted a key in 6 hours
19:17:00 <mrvn> They have something that works in a labatory.
19:18:00 <demindir1> I think the Hertzbleed issue is much less severe than many seem to think. From what I can tell they only managed to exploit SIKE on a server that does nothing but crypto calculations.
19:18:00 <GeDaMo>
19:18:00 <bslsk05> ​ Hertzbleed Attack
19:18:00 <demindir1> Note that more popular algorithms such as RSA or Curve25519 are not tested
19:19:00 <heat> it was important enough that cloudflare, intel and microsoft have known about this since Q3 2021
19:19:00 <mrvn> "Previous works had shown that SIKE is vulnerable to differential power analysis"
19:19:00 <mrvn> The only new thing I see in the paper is that they measure it remote.
19:58:00 <sbalmos> gah, head just imploded. took a while for me to understand VMOs go inside VMARs. But why would you have multiple VMARs? And don't start on the whole kernel VDSO thing.
19:59:00 <mrvn> "Vastus Medialis Oblique (VMO) is one of four quadriceps muscles"
19:59:00 <mrvn> VMAR = Vision Marine Technologies inc?
19:59:00 <sbalmos> Zircon stuff
20:00:00 <mrvn> virtual memory address range?
20:00:00 <heat> sbalmos, the same reason why you can mmap things multiple times
20:00:00 <mrvn> or array?
20:00:00 <heat> different regions have different permissions, different sources (VMOs)
20:00:00 <heat> mrvn, the first iirc
20:00:00 <sbalmos> yes
20:01:00 <sbalmos> heat: I have a feeling I'm just getting lost in the terminology
20:01:00 <sbalmos> (it sucks getting old(er), things not clicking quite as quickly)
20:01:00 <heat> sbalmos, try doing pmap $$ in your bash shell
20:01:00 <mrvn> sbalmos: get a piece of paper and a pen and draw out the structure with an example.
20:01:00 <heat> each entry is a vmar in linux
20:03:00 <sbalmos> see I would've thought that you had a single process vmar representing the whole vm address space of that process, and then separate vmos in that vmar for each of those entries
20:06:00 <geist> sbalmos: that's precisely how it works
20:06:00 <geist> you start with a single vmar that represents the entire address space
20:07:00 <geist> and you can subdivide it with sub-vmars, with different (restrictive) permissions
20:07:00 <geist> that way you can for example say 'only this sort of stuff goes here'
20:07:00 <geist> most processes really just have one or two vmars
20:07:00 <heat> zircon's vmars work like a tree
20:07:00 <sbalmos> that's what I figured
20:07:00 <heat> more traditional designs work like an array
20:08:00 <sbalmos> that's why I was getting hung up was the single all-encompassing vmar by default to a new process
20:08:00 <geist> can help you with that if you need it, being that i designed most of that
20:09:00 <geist> it's a bit of a conceptual leap but i think straightforward once you get the objects sorted out. it's just more 'basic' than a traditional mmap style scheme
20:09:00 <geist> ie it's the bits and pieces you can build more complex things out of
20:09:00 <geist> whcih is in general the strategy of ukernel apis
20:09:00 <heat> join geist's school of vm design
20:09:00 <heat> we have mojitos
20:09:00 <sbalmos> I'm a bourbon guy, but I'll take the mojito
20:09:00 <geist> re: the VDSO i think that's pretty neat and a cool design we did
20:09:00 <geist> it has really come in handy too
20:10:00 <sbalmos> where'd all the good rum go?
20:10:00 <heat> we're not pirates
20:10:00 <heat> i'm not opposed to that though
20:11:00 <mrvn> sbalmos: 99-bottles challenge on leetcode
20:11:00 <sbalmos> geist: you do sub-vmars to child processes or threads?
20:11:00 <heat> no
20:12:00 <heat> each process has its own address space
20:12:00 <heat> and threads share an address space
20:12:00 <sbalmos> right...
20:12:00 <heat> sub-vmars is just a way to partition stuff
20:12:00 <sbalmos> to itself (the same process)
20:13:00 <geist> yep. you can say for example create a child vmar that is 0-4GB, and use that for low memory allocations
20:13:00 <heat> you have [0x0 - 0x7f....], the main div; and then you could have a [0x1000 - 0x30000000] for the main executable, [0x300000000 - 0x500000000] for the heap/mmap, and [0x500000000 - 0x7f....] for stacks and shared objects
20:13:00 <geist> anything you allocate out of that vmar end sup there
20:13:00 <sbalmos> sorry, now I was slipping into Genode concept territory, while a parent process tells a child process "you only get 2GB, from 0-4000" at spawn
20:14:00 <heat> then individual vmars (think mmaps) would partition each partition
20:14:00 <heat> partitioning all the way down homie
20:15:00 <geist> yah you can do the same thing in zircon, but it's just done with the vmar scheme: the parent can create the child process, subdivide the vmar, and then only hand the child the sub vmar
20:15:00 <heat> VMOs are the backend of a VMAR, they let it populate pages when faulting in, do writeback, etc
20:15:00 <geist> since theres no want to 'mint' a new handle after the fact
20:15:00 <geist> heat: to be precise VMOs are completely independent of VMARs
20:15:00 <sbalmos> geist: I think that's where I was mentally going, more classically
20:15:00 <mrvn> can you add VMARs to threads only?
20:15:00 <mrvn> thread local VMARs
20:15:00 <heat> yes, VMOs are independent but serve as the backend for VMARs
20:16:00 <geist> vmos are simply a bag of bits. you dont have to map them, mapping them is what you use vmars for, but vmos can exist entirely outside of any mapping
20:16:00 <sbalmos> geist: and then VMOs are essentially a group of kernel-level VM pages?
20:16:00 <geist> heat: not precisely. again, vmars are the *space* you map a vmo into
20:16:00 <heat> mrvn, seems conflicting with "per-process address space"
20:16:00 <geist> a mapping is that, a mapping. it's not a vmar, or a vmo
20:16:00 <geist> you map inside a vmar
20:16:00 <geist> it's a common misconception
20:17:00 <heat> hmm I see
20:17:00 <geist> sbalmos: basically. it's a bag of data, 0-64bits. tehre are multiple types of them
20:17:00 <heat> sorry, I failed you master
20:19:00 <sbalmos> like trying to mentally digest a porterhouse steak when you know the anatomy of a hog
20:20:00 <mrvn> you don't want to know how sausages are made
20:21:00 <geist> that's part of the fun of capability and ukernel designs: you try to break down common user patterns into a series of pieces and then give user space the ability to efficiently construct it
20:22:00 <geist> so you have to remember that in many/most cases average applicatino code should probably not be sitting directly on the syscall api
20:22:00 <geist> it's okay to build stuff that's intrinsically more fragile or fiddly with the assumption you'll build some sort of user space library or whatnot to encapsulate that
20:22:00 <mrvn> .oO(C code has text, heap and stack. Just give userspace 4GB of address space and dynamically map pages on demand)
20:23:00 <geist> sure, you can do that in zircon easily (though you could in linux or whatnot too)
20:23:00 <heat> that was my first VM design
20:23:00 <heat> map any page when faulting
20:24:00 <heat> well, design is a strong word :P
20:24:00 <mrvn> my first design just mapped a few pages at the start and hoped it's enough
20:25:00 <heat> actually, no, that was my first vm design with userspace
20:25:00 <heat> my *first* vm design used large pages for everything
20:25:00 <heat> I also had a horrible, buggy heap. each bucket allocated 4MB for itself
20:25:00 <mrvn> you mean you didn't map individual obejcts but just had a big address space?
20:26:00 <heat> no objects here
20:26:00 <heat> just plain vm_map(address, length, perms)
20:26:00 <heat> oh yeah ofc no address allocation as well
20:26:00 <heat> hardcoded large pages >> linux
20:26:00 <mrvn> So allocation a struct Task would use 2MB?
20:27:00 <heat> no
20:27:00 <heat> the size bucket would use 4MB
20:27:00 <heat> if you ran out of memory... tough shit
20:27:00 <heat> ran out of memory in the size bucket, that is
20:31:00 <heat>
20:31:00 <bslsk05> ​ Onyx/heap.c at 9d6c0cc7f876ae06687eadd1d0d076b2ee50fce1 · heatd/Onyx · GitHub
20:31:00 <mrvn> My memory management is super simple. phyiscal pages are in a stack, each process (and the kernel) has a PageTable with an iterator pointing at the next palce to map pages. You allocate something then it maps pages and increments the iterator by one more. If it hits the end of the PageTable it panic()s.
20:31:00 <heat> worth noting that this was GPLv2 code lol
20:31:00 <heat> also soooo bad
20:31:00 <heat> embarassingly bad almost
20:32:00 <heat> very fun to see my evolution in a single git repo
20:32:00 <mrvn> I should really implement the warp around for the iterator.
20:53:00 <alethkit> Hi there! What are your thoughts on exokernels?
20:54:00 <mrvn> yes
20:54:00 <alethkit> Yes?
20:54:00 <mrvn> bunnies?
20:54:00 <mrvn> invisible pink unicorns
20:55:00 <mrvn> What are your thouhgs on cars?
20:55:00 <sonny> exokernels is what allows for the library OS?
20:56:00 <mrvn> it's DOS in a library :)
20:56:00 <alethkit> sonny: Pretty much
20:57:00 <sonny> seems really tedius unless you have a special need for it, like long running server apps that need as little overhead as possible
20:57:00 <sonny> or maybe deeply embedded stuff
20:57:00 <mrvn> or spooling up apps as VM instances
20:57:00 <sonny> yeah
20:57:00 <alethkit> Spooling?
20:57:00 <mrvn> booting
20:58:00 <alethkit> Ah, right.
21:02:00 <alethkit> I was trying to figure out a way to get around the driver chasm, and exokernels seemed like the best idea
21:02:00 <heat> not feasible if you need security
21:02:00 <alethkit> Why not?
21:02:00 <heat> driver chasm?
21:02:00 <heat> it's a library. your rando not-virus.exe can see everything that's going on
21:03:00 <sonny> alethkit I'm pretty sure exokernel is only popular for networking
21:05:00 <alethkit> heat: Driver chasm refers to the fact that no new hobby/research OSes can take off because writing drivers is a PITA
21:05:00 <heat> rumpkernel
21:05:00 <alethkit> And I thought that the libOSes were isolated?
21:05:00 <heat> also, nothing really takes off because there's no advantage
21:06:00 <heat> internal APIs are usually very different. using the bare API gives you some big advantages
21:07:00 <alethkit> The bare API being the kernel's userspace API?
21:07:00 <heat> no, the kernel's internal API
21:08:00 <mrvn> alethkit: you only need to support a handfull or virtio devices.
21:16:00 <sbalmos> geist: okay, mind is starting to solidify... but if a vmo is the representation of a extent of kernel vm pages, and a process has to map it into a vmar in order for the vmo to be part of its per-process address space... what's the practical use of a vmo that isn't mapped? The only thing that could read/write from an unmapped vmo would be the kernel then, right?
21:18:00 <heat> bag of bytes you can read/write and pass to other processes
21:18:00 <heat> like a temporary file
21:19:00 <heat> it's pretty much an inode in a filesystem sense
21:19:00 <sbalmos> right I know. But it's just the object level of "here's 4k of memory that is writable". But the vmar mapping is what says that 4k exists at process address space 0x123456
21:19:00 <heat> an unnamed inode I mean. has data, can be mapped, will go away after closing
21:20:00 <alethkit> mrvn: I guess that makes sense for a hobby OS, but I have no idea what to do now
21:20:00 <alethkit> My intention was to get the exokernel to load on an old computer so I could have multiple OSes knocking about on bare metal
21:21:00 <sbalmos> so unless it's vmar mapped, it can't be used by a process because it doesn't exist in the process's address space, and therefore the only thing left (e.g. not a userspace process) which could read/write it is the kernel
21:21:00 <heat> sbalmos, it has syscalls attached to it
21:21:00 <heat> read, write, etc
21:21:00 <heat> you don't need to map it, but you can
21:21:00 <heat> just like a file
21:23:00 <sbalmos> maybe that's the next conceptual leap. Process requests 4k to write to, it gets a VMO. It doesn't/has no way to know where that 4k lives in its per-process address space, but it can do whatever with it. like an fd/inode. It could then mmap that to a vmar for whatever purpose if desired.
21:24:00 <heat> VMOs don't live anywhere in the per-process address space until they're mapped
21:24:00 <heat> they're only present as a physical page + a physmap mapping as usual
21:25:00 <sbalmos> right...
21:27:00 <geist> right, the closest analogy to a vmo handle is a handle to a deleted file in a tmpfs in posix
21:27:00 <geist> ie, you can read/write it directly, and infact it's precisely the basis for memory mapping files and whatnot
21:28:00 <geist> and the actual read/write syscalls are the mechanism by which you cna read/write files in a remote FS server, which vends VMOs as part of its api
21:28:00 <geist> but vmos also form the basis behind anonymous memory, much like mmap("/dev/zero") in that sense
21:29:00 <geist> vmos are also snapshottable (create private copy on write clones of it) so you also get the mechanism to do mmap(..., PRIV)
21:34:00 <sbalmos> mentally I was just going for this middle space below a typical userspace program possibly requesting from the allocator "gimme 4k of ram, preferably from this previously-defined address space". It's a little lower level where the memory range itself could be separately r/w as an opaque "file" (bad relation, I know), before traditionally becoming an actual per-process address space range
21:34:00 <sbalmos> same idea for shared mem i/o
21:36:00 <geist> yah also shared mem with vmos is intrinsic: you simply give another process a vmo handle
21:36:00 <sbalmos> right
21:36:00 <geist> then it is free to access the same thing. there's no separate mechanism for it
21:37:00 <sbalmos> though then my head starts floating to processes using (untyped) shmem rather than (typed) channels, etc
21:37:00 <mrvn> do VMOs have a reference count?
21:37:00 <geist> yes
21:38:00 <geist> all objects do. all kernel objects are removed when the last ref goes
21:38:00 <geist> if you mean: can user space read the ref count, no
21:39:00 <geist> that would at best be a TOCTOU problem anyway
21:40:00 <sbalmos> next dumb question, any reason why the syscall prototypes all work on the base zx_handle_t type, rather than say having a zx_vmo_handle_t, zx_proc_handle_t, etc subtypes?
21:41:00 <heat> it's just a number
21:41:00 <heat> exactly like a fd
21:41:00 <heat> (but random?)
21:41:00 <heat> it's not typed
21:41:00 <geist> that's right. there's a single handle table, all objects are in the same table
21:41:00 <geist> and some syscalls operate on all handles, like get info, etc
21:42:00 <geist> and clone handle, close handle, etc
21:42:00 <sbalmos> right, but it's wrong to say they're not typed when the syscalls all say "handle must be type ZX_OBJ_TYPE_PROCESS" etc
21:42:00 <sbalmos> I get that at that point it's a type field on the handle struct.
21:42:00 <heat> but C isn't strongly-typed
21:43:00 <sbalmos> ah, see there's the dumb-idiot kicker. this is C level, not C++?
21:43:00 <heat> typedef uint32_t zx_proc_handle_t and typedef uint32_t zx_vmo_handle_t will both implicitly cast from one to the other
21:43:00 <heat> C
21:43:00 <heat> (doesn't C++ also do this? I believe so)
21:44:00 <heat> you /could/ try to get around it with fancy C++ though, but at the end of the day the syscall gets a uint32_t
21:44:00 <heat> I believe there are C++ bindings for zircon somewhere in the codebase
21:44:00 <sbalmos> nevermind
21:44:00 <j`ey> I thought zircon was C++?
21:44:00 <sbalmos> no idea why, but stuff like that bugs the frickin' heck out of me
21:45:00 <heat> i meant for the syscall layer
21:45:00 <heat> you have the usual C bindings and then some C++ stuff as well
21:46:00 <sbalmos> seemed like there would've been a more typesafe way of differentiating handle types
21:47:00 <heat> in C++ there probably is, not in C though as far as I can see
21:47:00 <j`ey> you still have to convert from a raw u32 at some point, since it just comes from a register
21:48:00 <heat> unless zx_handle_t's become structs? in which case things may start to go bonkers in codegen
21:48:00 <sortie> xz is so yesterday's port
21:48:00 <sortie> Today libxml2 is all the rage
21:49:00 <sbalmos> typedef struct { uint32_t hid; } zx_handle_t ?
21:49:00 <heat> yes
21:49:00 <heat> i think that works?
21:51:00 <heat> yeah it works, but now it's too strongly typed and you can't implicitly cast to the base type
21:51:00 <sbalmos> gaaah
21:52:00 <heat> C bad
21:52:00 <sbalmos> screw C, C++ only :P
21:52:00 <sbalmos> or Rust
21:52:00 <heat> Go only
21:53:00 <gamozo> RUST ONLY
21:53:00 <heat> REWRITE IT IN RUST
21:53:00 <sbalmos> oh well, time to escape the too-hot home office for the day
21:53:00 <sortie> RUST FREE OR DIE
21:53:00 <sbalmos> thanks for bearing through my denseness
21:53:00 <gamozo> Everyone in here is dense
21:53:00 <gamozo> this is one of the densest places on the internet
21:54:00 <gamozo> we do osdev "for fun"
21:54:00 <heat> i'm Osmium
21:54:00 <sortie> I finally got around to ship my new lightweight BSD-style ports system for Sortix :) :) :)
21:54:00 <sortie> Just took me half a year
21:54:00 <gamozo> Are you maintaining the packages or using an existing repo?
21:54:00 <heat> gamozo, i do it for fun and profitz
21:54:00 <sortie> ← I even, you know, wrote friendly documentation
21:54:00 <heat> how bout that
21:54:00 <bslsk05> ​ porting(7)
21:54:00 <gamozo> heat: Lots of profit in osdev :laugh:
21:55:00 <heat> there is lol
21:55:00 <sortie> gamozo, yeah I got my own collection of ports with patches
21:55:00 <heat> *wrote his own full fledged POSIX OS* is a unique CV project
21:55:00 <gamozo> Yeah but like, "spent 3 minutes doing ML in python" is who's gonna get the job ;)
21:56:00 <sortie> Some of us use our profits to waste away on osdev
21:56:00 <sbalmos> my profits pay for avgas
21:56:00 <heat> tensorflow experience > operating system
22:03:00 <energizer> heat: how does one make money in osdev? i sorta assumed the only options were working on one of the major OSes at one of the bigcos
22:03:00 <heat> yes that's what I said
22:03:00 <sbalmos> more likely embedded work
22:04:00 <sbalmos> firmware is (can be) fun
22:04:00 <heat> fake news
22:04:00 <heat> have you looked at an .fdf?
22:04:00 <heat> fucking fun?
22:04:00 <sbalmos> FSVO "fun"
22:06:00 <gamozo> Firmware dev looks fun from the outside, I've always wondered what it's like to write code without any concern about stability or standards
22:06:00 <sbalmos> ...
22:06:00 <heat> bhahahahahha
22:06:00 <sbalmos> uhm, that would be enterprise microservices then
22:07:00 <mjg_> gamozo: lol
22:07:00 <sbalmos> fuck it, just restart the process. it'll come back up eventually
22:08:00 <mjg_> energizer: you can make money working on major OSes in small shops as well :)
22:08:00 <heat> gamozo, the best part of firmware dev is the <s>shitty</s>unique build system
22:08:00 <mjg_> energizer: there is way too many "embedded" devices, and don't get me started on iot
22:09:00 <mjg_> hardware people hate programmers
22:09:00 <mjg_> change my mind
22:09:00 <sbalmos> mjg_: edge computing! :D
22:09:00 <heat> probably
22:09:00 <gamozo> ahahahahahaha
22:09:00 <heat> sbalmos, I feel attacked
22:09:00 <sbalmos> heat: Goooood goooooooooood, let the hate flow through you...
22:11:00 <heat> the build system we use is 100x more sane than EDK2's
22:11:00 <heat> therefore, I win
22:12:00 <heat> and we actually sanitize and fuzz code
22:12:00 <mjg_> gcc -o crap *.c
22:12:00 <mjg_> found in ""
22:12:00 <mjg_> actual build system, modulo file name, i had seen
22:13:00 <heat> more sane than edk2's still
22:13:00 <sbalmos> make clean build publish clean && shutdown -p "beer:30"
22:14:00 <sbalmos> make mojito *** No rule to make target 'mojito'. Stop.
22:14:00 <sbalmos> dammit!
22:14:00 <mjg_> make sense
22:14:00 <mjg_> Segmentation fault
22:14:00 <mjg_> well shit
22:16:00 <heat> toybox's build system is a makefile tha
22:16:00 <heat> that invokes a script that compiles everything
22:17:00 <heat> bcuz AOSP wanted self-sufficient utilities ig
22:17:00 <mjg_> wow, you were not kidding
22:17:00 <heat> safe to say that all these build systems are more sane than autotools
22:18:00 <heat> mjg_, hm?
22:19:00 <mjg_> > 00:13 < heat> more sane than edk2's still
22:19:00 <heat> yeah lol
22:19:00 <heat> looking at edk2's build system?
22:19:00 <heat> everything is overridable in 10 different places
22:19:00 <heat> also *everything is a fucking GUID*
22:35:00 <sbalmos> a sha hash is better? :D
22:37:00 <gamozo> 2010s devs love GUIDs
22:38:00 <heat> gamozo, this was designed in the 2000's microsoft GUID kool aid era
22:38:00 <heat> so obviously everything needs to have a GUID
22:39:00 <heat> my co-mentor (long time Intel FW engineer) in the edk2 GSoC has a vscode extension to generate GUIDs
22:39:00 <gamozo> Oh yeah... I forgot about the whole PE side
22:39:00 <doug16k> they are effective as scarecrows to scare people away. who wants to edit "{a1bc23cb-3456-bcde-abcd-feb363cacc88}"
22:39:00 <heat> wintel people
22:40:00 <gamozo> (although, I still like PE more than ELF!)
22:42:00 <heat> booo
22:42:00 <gamozo> They have their pros and cons!
22:43:00 <heat> boooooooooooooo
22:43:00 <heat> UNIX is kool
22:43:00 <gamozo> DWARF is a terrible format and should be illegal
22:43:00 <heat> so a.out or ELF
22:43:00 <heat> gamozo: MOFO WHERE U LIVE MF I WILL BEAT U UP
22:44:00 <gamozo> so harsh
22:45:00 <heat> dwarf iz best 4mat
22:45:00 <heat> pdb bad
23:02:00 <sbalmos> heh
23:03:00 <sbalmos> I was on the CLR-kernel bandwagon my senior year back in '06. Groaned at PE but whatever.
23:04:00 <sbalmos> that was fun, from an on-paper conceptual standpoint
23:05:00 <geist> re: type safety handles and whatnot
23:05:00 <geist> yes, there are language specific libraries on top of the syscall layer that do precisely that
23:05:00 <geist> libzx for c++ iirc, and there's a rust version of it
23:05:00 <geist> it encapsulates a bunch of that logic, though of course you're free to force one handle type to another
23:06:00 <geist> and the kernel will obviously test. but the raw api for the syscall is C, because that's the base abi that you can actually nail down now and forever more and build bindings for other languages
23:06:00 <geist> that's why the VDSO itself exports C functions
23:07:00 <sbalmos> ya I figured the higher-level bindings did that
23:07:00 <geist> there *is* a syscall to ask what kind of handle this is, or if the handle is valid, etc
23:08:00 <geist> so you can if given a random handle, validate that it's what you think it is
23:18:00 <doug16k> do you have a mechnism that tries not to give a process the same handle twice, in case of use after close?
23:20:00 <sbalmos> I know this is probably now melding the vx_* syscall layer vs the userspace bindings libs... is there a capability that has to be granted or something for a process to allocate from heap? otherwise what prevents a process from calling vx_vmo_create(BIGASSSIZE, ...) or being restricted to some amount of total vm granted by the parent
23:24:00 <heat> ZX_POL_NEW_VMO
23:24:00 <heat> RTFM
23:24:00 <bslsk05> ​ zx_vmo_create  |  Fuchsia
23:25:00 <doug16k> windows gets sprayed by use after close
23:25:00 <heat> zircon has job policies as a very basic seccomp filter
23:28:00 <sbalmos> yeah, missed the policy thing. though that's job-level, and that's basically a you-can/can't-create-vmos, no restriction on size or anything
23:35:00 <heat> job = process here afaik
23:36:00 <heat> ok no im wrong
23:36:00 <heat> i'll give myself the L
23:36:00 <heat> if you have fuchsia questions you should join the fuchsia discord sv
23:37:00 <sbalmos> oh gimme another day, I'll have moved on to another OS to study. ;)
23:38:00 * heat drops
23:38:00 <bslsk05> ​heatd/Onyx - UNIX-like operating system written in C and C++ (2 forks/49 stargazers/MIT)
23:38:00 <heat> it fell of a truck
23:40:00 <sbalmos> oh so that's what caused the afternoon highway pileup