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

Saturday, 2 September 2023

11:14:00 <nortti> apropos the vax discussion last evening, why does it use that kind of paging anyways? is the 512 byte page size to align with the sector sizes on disk media?
11:32:00 <netbsduser> nortti: yes, exactly that
11:34:00 <netbsduser> they were pioneering with respect to virtual memory and were concerned that a page size not equal to the physical block size of disks would be harmful to that
11:36:00 <nortti> and I guess linear page tables were for simplicity of implementation?
11:37:00 <netbsduser> i think it would´ve been specifically for the simplicity of implementing pageable user page tables
13:06:00 <zid> hello feet
14:01:00 <heat> gello
14:18:00 <mcrod> hi
15:03:00 <Ermine> heat: how do you feel yourself
15:03:00 <heat> i feel like ass
15:03:00 <heat> at least i feel better than yesterday morning but that's a low point innit
15:04:00 <heat> still have issues eating but im kinda hungry
15:04:00 <heat> dreamed about eating kitkats ngl best dream ever
15:05:00 <Ermine> that sucks
15:06:00 <heat> it does but At Least Im Not Puking
15:06:00 <heat> And Im Watching The Footy
15:22:00 <gog> HI I'M SAD
15:22:00 * kof123 .oO( innit init system )
15:22:00 <gog> and i'm doing capslock by accident
15:27:00 <kof123> why are you sad gog?
15:28:00 <Cindy> gog: hi sad i'm sad
15:29:00 * ChavGPT hugs gog
15:29:00 <ChavGPT> there there
15:32:00 <heat> gog: SAD is actually a type of company here in portugal
15:42:00 <Ermine> gog: may I pet you
15:42:00 <gog> hi
15:42:00 <gog> yes
15:42:00 <gog> probably nothing idk
19:12:00 <x8dcc> is it a good idea to store the FPU/SSE state with fxsave when initializing multitasking and then using that as base when creating new tasks?
19:13:00 <heat> erm
19:13:00 <heat> maybe?
19:13:00 <heat> so, it's kinda useless
19:14:00 <heat> there's only 1/2 words of state you need to set when initializing an FPU context, and those can be set directly in the xsave map easily
19:14:00 <heat> only one even
19:14:00 <bslsk05> ​ Onyx/kernel/arch/x86_64/fpu.cpp at master · heatd/Onyx · GitHub
19:15:00 <heat> if everything else in the FPU area is zeroed you have an EZPZ FPU SQZ
19:19:00 <x8dcc> that's helpful, I will do that instead
19:19:00 <x8dcc> thank you :)
19:29:00 <heat> np
19:34:00 <geist> yah i think they explicitly set it up so that all zeros is the default. at some point i decoded how all of that compressed xsave stuff works, but its a little wonky
19:35:00 <geist> but i think some of the wonkiness is because of the zero-is-default-state mechanic
19:41:00 <geist> nortti, netbsduser: also re: the vax linear paging, it was an era when a full 32bit address space was huuuuuge, generally well beyond the size of the largest machine
19:41:00 <geist> so the ability to restrict the user space with a length field and not use up a large page table probably seemed like a good idea
19:42:00 <geist> though i guess the radix tree style page table also accomplishes fairly the same thing
19:42:00 <geist> as far as i know even in the later vaxen, when the initial 29 bit physical address space was startig to be a problem they still used the linear map
19:42:00 <geist> seems like the kernel aspace would start getting pretty cramped with page tables by then
19:43:00 <nortti> how big is a page table entry on VAX?
19:43:00 <geist> 4 bytes, fairly standard set of fields by modern standards
19:44:00 <geist> but in initial designs 29 bits was the max physical size, the real virtual space is chopped up in a few weird ways, though not weird if you've worked with avr32, mips, or sh-4. fairly standard hard chopping of the whole aspace into user, identity map, kernel, etc
19:45:00 <geist> only thing in the page table entries thats kinda neat is it has the ring level in it, so it's more powerful than 386's mapping of rings to user/supervisor. you can set which ring the page becomes accessible in
19:47:00 <samis> that's why VMS has a number of rings and unlike x86 actually uses them
19:47:00 <samis> right?
19:48:00 <geist> yeah. i think the other way of looking at it is vax had a number of rings that it intrinsically used (or VMS did at least), and intel copied that with 286 but was never really used that much
19:48:00 <nortti> hm, OS/2 used rings for device drivers on 80286, right? what did it do for 386?
19:48:00 <geist> i think OS/2 was the main user of rings, yeah
19:49:00 <geist> i booted OS/2 on qemu one time and broke into it a few times to see what the state of the cpu was and it was definitely using ring 2 a lot
19:49:00 <geist> how that really gets you much protection since the paging scheme only gives you 2 i dunno
19:49:00 <geist> but i suspect they split the kernel up into core kernel and then some sort of supervisor level drivers/etc code so maybe there was a bit of advantage there
19:51:00 <geist> you can learn quite a bit by booting something like dos with emm386.sys or win 3.1 on qemu and just breaking into it and see how it's using the GDT and page tables
19:51:00 <geist> pretty educational
19:52:00 <zid> or forgeddaboutit
19:52:00 <zid> it's 2023 baby, 64bit virtual address spaces for everyone
19:53:00 <nortti> does any CPU architecture actually give 64 bits of virtual address space?
19:53:00 <zid> Not sure actually
19:53:00 <nortti> afaict 39, 48, and 56 seem like the common values
19:53:00 <zid> "48 is the best I can do" --CPU makers
19:53:00 <geist> fairly sure ia64 does
19:53:00 <nortti> oh, interesting
19:53:00 <nortti> does it just do a deeper radix tree?
19:54:00 <geist> iirc it chops the full virtual space into 8 separate zones, each zone has it's own paging structure
19:54:00 <geist> so you can use that however you want, 2:2, 7:1, 1:6:1, etc
19:54:00 <geist> so each paging structure deals with 2^61 of it
19:54:00 <geist> but basically that means you have up to 8 things to context switch
19:55:00 <geist> depending on how you choose to use it
19:55:00 <geist> and no ia64 does not use a radix tree at all, it's a very very different design
19:55:00 <geist> closer to POWER/PPC but it has two modes that you can choose per structure iirc
19:55:00 <geist> basically part of the control register set up
19:56:00 <geist> long vs short page table entries, etc. but one of the modes looks a bit like vax in the sense that it's a large linear page table that lives in virtual space
19:56:00 <geist> iirc that's the short page table entry mode, the long mode is i think closer to POWER in that it's a huge hash table
19:58:00 <geist> i think those page table entries are 16 bytes long, iirc
19:58:00 <geist> been a while, actually heat grokked it all at once
19:58:00 <geist> ITAAAAANIUM
20:10:00 <heat> nortti: don't forget 36 btw, afaik 36 is also pretty common
20:12:00 <heat> hm sorry 36 bits seemsto be common for a physical address
20:14:00 <heat> also it's 57
20:15:00 <heat> you go 48 -> 57 cuz of 9 extra bits
20:15:00 <heat> and on ARM, 49 -> 58
20:16:00 <heat> IF they have 58-bit addressing, which I don't think they do?
20:16:00 <childlikempress> I thought arm had a 52-bit thing?
20:16:00 <heat> (ARM has an extra bit because it has two radix trees instead of one)
20:16:00 <heat> idk, probably
20:16:00 <heat> i don't remember all the details, i just did 48-bit
20:17:00 <heat> *49
20:21:00 <netbsduser> interestingly the VMS port to Alpha was done by implementing a vax macro assembly 2 alpha compiler
20:25:00 <heat> good
20:25:00 <heat> what a great solution
20:25:00 <heat> up yours dave cutler
20:29:00 <childlikempress> remember #define rax x0 from apple or whatever it was
20:46:00 <heat> with all the registers arm has you could even define-emulate MMX
20:46:00 <heat> imagine the possibilities
20:56:00 <childlikempress> ooh I just realised something
20:56:00 <childlikempress> the x87 stack has 8 elements
20:57:00 <childlikempress> so you can shove the entire thing into an avx512 register and emulate the stack ops with shuffles
20:59:00 <gog> RYYYYYZEN
21:02:00 <heat> thank you childlikempress, very cool!
21:03:00 <x8dcc> heat: I am setting [edx + fpu_data.mxcsr] (allocated+0x18) to dword 0b0001111110000000 (0x1F80) but now I am getting a x87 floating point exception :(
21:04:00 <heat> then something else is wrong
21:04:00 <heat> because That Just Works(tm)
21:04:00 <x8dcc> rest of the 512 bytes are zeros
21:05:00 <x8dcc> the exception occurs on a fstp instruction
21:05:00 <kof123> one small step for x87, one giant leap towards pages in registers
21:06:00 <heat> wait
21:06:00 <heat> why the fuck do you have x87 instructions?
21:07:00 <x8dcc> not sure
21:07:00 <childlikempress> kof123: the avx512 state is 2kb
21:07:00 <childlikempress> and an avx512 instruction has a 2-bit register size header whose meanings are: 16 bytes, 32 bytes, 64 bytes, unassigned
21:07:00 <childlikempress> SO they could double the register size still, and literally store a page in registers
21:07:00 <childlikempress> HTH.HAND
21:08:00 <heat> oh, 32-bit codegen uses x87 by default
21:08:00 <heat> ew
21:08:00 <childlikempress> -msse or sth
21:08:00 <childlikempress> or just do 64 bit
21:08:00 <heat> x8dcc: did you configure the FPU properly
21:08:00 <heat> where are you catching this exception? hopefully not the kernel?
21:09:00 <x8dcc> I think I configured fpu properly, but I usually my errors happen because I think I did something right when I didn't
21:09:00 <x8dcc> childlikempress: I use -msse and -msse2 currently
21:09:00 <heat> where
21:10:00 <heat> what is crashing?
21:10:00 <x8dcc> my %f format for printf
21:10:00 <x8dcc> and I only have kernel, I don't have userspace or anything
21:10:00 <heat> oh god
21:10:00 <heat> don't
21:10:00 <x8dcc> I haven't touched the project in some months
21:10:00 <heat> rm -rf %f handling
21:11:00 <heat> and then rm -rf -msse -msse2 from your kernel's CFLAGS
21:11:00 <childlikempress> don't do fp in kernel
21:11:00 <x8dcc> well I don't have anything else haha
21:12:00 <zid> afaik in linux to do fp you have to call a special lock + init function, do your shit, then release?
21:12:00 <zid> and it's only used by like, the crypto api
21:12:00 <x8dcc> childlikempress: why is it bad to use fp in kernel?
21:12:00 <childlikempress> I think there's a flag you can pass to tell the compiler to refuse to emit any kind of fp code? Or do a softfp even when the hardware supports hardfp? (Which amounts to the same thing--don't link in the softfp lib, so you'll get a link error if you try to use it)
21:12:00 <zid> -mgeneral-regs-only for life
21:12:00 <zid> Then never bother to make a libgcc, so that if you ever need one it fails to link
21:12:00 <childlikempress> yeah that was it
21:12:00 <childlikempress> no why what's wrong with libgcc
21:13:00 <zid> it'll have the float cast etc code in it
21:13:00 <childlikempress> oh
21:13:00 <heat> x8dcc: floating point sucks, and you'll need to consistently save/restore FPU regs after kernel entries and exits
21:13:00 <heat> which is expensive
21:14:00 <x8dcc> well that's a bit depressing
21:14:00 <heat> why?
21:15:00 <x8dcc> because I spent a lot of time trying to fix stuff related to this for nothing
21:15:00 <x8dcc> but whatever
21:15:00 <zid> fairly sure you were told not to last time too
21:15:00 <x8dcc> don't remember, but you might be right
21:16:00 <x8dcc> learned in the process so I don't mind that much
21:16:00 <childlikempress> I mean tbf it _should_ work, since you're not actually doing any context switching (I presume)
21:16:00 <heat> oh god
21:16:00 <bslsk05> ​ Compiler Explorer
21:16:00 <childlikempress> so it is a bit suspicious
21:16:00 <zid> you still need to enable floating point in the control reg and stuff
21:16:00 <childlikempress> that it doesn't. But still, shouldn't, so
21:16:00 <zid> and make sure it generates the right alignments etc
21:16:00 <heat> i can't convince 32-bit gcc to FPU using SSE
21:17:00 <heat> zid: and actually load the mxcsr/fxsave state
21:17:00 <zid> is that not what I said
21:17:00 <heat> no you just mentioned the control regs
21:18:00 <childlikempress> heat: -mfpmath=sse
21:18:00 <heat>
21:18:00 <bslsk05> ​ Onyx/kernel/arch/x86_64/fpu.cpp at master · heatd/Onyx · GitHub
21:18:00 <zid> Loads the source operand into the MXCSR control/status register.
21:18:00 <zid> control register.
21:18:00 <heat> ok
21:18:00 <x8dcc> well what should I work on next
21:18:00 <zid> 802.11b
21:18:00 <childlikempress> can you allocate memory
21:18:00 <heat> childlikempress: ew fpmath=sse generates horrendous code
21:18:00 <x8dcc> yes I can
21:18:00 <childlikempress> i suggest being able to allocate memory
21:19:00 <heat> for the float func at least
21:19:00 <x8dcc> I spent a lot of time
21:19:00 <childlikempress> heat: it has to return on x87 because of the abi
21:19:00 <zid> I spent hardly any time on mine it's awful <3
21:19:00 <childlikempress> try void f(float *x) { *x += 10; }
21:19:00 <x8dcc> I mean a lot of time adding alignment for allocations for fxsave
21:19:00 <x8dcc> for nothing (for now)
21:19:00 <zid> you'll want a userspace libc though?
21:20:00 <x8dcc> I don't have an userspace, I have most of my libk code in libc but I just stopped even syncing it with libk because I was not using it
21:20:00 <zid> you'll -> you will
21:20:00 <zid> future tense
21:20:00 <zid> You just wrote it early is all
21:21:00 <x8dcc> yeah I know
21:21:00 <x8dcc> still, I think it's missing whatever it is that separates libk from libc :)
21:23:00 <heat> have you considered getting to userspace?
21:23:00 <zid> my userspace is amazing isn't it heat
21:23:00 <heat> yes
21:23:00 <heat> high quality
21:23:00 <heat> emulators
21:23:00 <zid> 0 syscalls
21:24:00 <zid> recompile entire kernel to change the userspace program
21:24:00 <x8dcc> heat: sure, but I don't really know where to start
21:24:00 <zid> I just shipped a binary with my kernel, mapped it cpl3 at 2M
21:24:00 <zid> and iret'd the kernel to it
21:24:00 <heat> x8dcc: what do you have?
21:24:00 <zid> can build from there
21:24:00 <x8dcc> I saw that, zid
21:25:00 <zid> timer to bring you back to kernel, filesystem to let you pick an /init, etc
21:25:00 <zid> good excuse to add APs afterwards also
21:25:00 <gog> hi
21:25:00 <gog> i don't program kernal
21:26:00 <zid> web development gives a wage
21:26:00 <zid> so that's understandable
21:26:00 <x8dcc> heat: not sure what to tell you, you can kinda guess by the filenames in the kernel dir, I guess
21:26:00 <heat> what kernel dir?
21:26:00 <x8dcc> hard to say what I have because I am not sure what I need/am missing
21:27:00 <x8dcc> heat: meant src/kernel/*.c
21:27:00 <heat> i don't know what your OS is
21:27:00 <heat> sorry
21:27:00 <x8dcc>
21:27:00 <bslsk05> ​ fs-os/src/kernel at main · fs-os/fs-os · GitHub
21:27:00 <zid> I have also not seen a single line of it
21:27:00 <x8dcc> I sent the link some months ago, I am sure of that
21:27:00 <zid> that'll be why
21:27:00 <zid> you also have a non-name name
21:28:00 <zid> for both irc and github
21:28:00 <zid> so it's hard to remember you/it between the month breaks
21:28:00 <x8dcc> the most important commit was made by heat
21:28:00 <x8dcc> zid: I understand, I don't mind
21:29:00 <heat> why do you have so many fucking commits holy shit
21:29:00 <x8dcc> I change stuff, I guess
21:29:00 <zid> rebase -i it down to about 3
21:29:00 <heat> they're wayyyyyyyy too granular pal
21:29:00 <x8dcc> I am sorry
21:29:00 <zid> meh they seem fine
21:30:00 <zid> It's just they would normally be hidden behind merges, or be part of a series
21:30:00 <zid> I don't like the lack of title style
21:30:00 <x8dcc> what?
21:31:00 <zid> "Align task stack to 16 bytes" -> "task/stack.c: Align stack to 16 bytes"
21:31:00 <heat> none of this should be in asm
21:31:00 <bslsk05> ​ fs-os/src/kernel/multitask.asm at main · fs-os/fs-os · GitHub
21:31:00 <zid> and then that'd normally be part of a small series of fixes that got 'merged'
21:31:00 <x8dcc> zid: I see
21:31:00 <zid> so you'd end up with [01/05] task: fix a, [02/5] task: fix b
21:32:00 <zid> etc
21:32:00 <zid> and you get a nice sort of visual grouping going on
21:32:00 <x8dcc> I get anxious when I have too many uncommited changes
21:32:00 <zid> so commit them?
21:32:00 <zid> You don't have to push before you rebase
21:33:00 <heat> your kernel should have way less asm
21:33:00 <zid> my locak tree is usually [master] then [wwwwww] [wasdf] [asdeir]
21:33:00 <zid> :D
21:33:00 <x8dcc> heat: Why does it matter
21:33:00 <zid> with commits on each branch that are 'fopd' 'asdasd'
21:33:00 <heat> unreadable, unportable, hard to extend
21:33:00 <x8dcc> zid: I honestly have to admire that
21:33:00 <zid> x8dcc: why not write it all in asm?
21:34:00 <zid> take whatever you're about to say as your answer
21:34:00 <zid> and apply it to the bits of asm in your code
21:34:00 <zid> done
21:34:00 <x8dcc> I like asm, but the entire thing would take too much time
21:35:00 <zid> that is infact, a fuck load of files ending in .asm
21:35:00 <zid> is that.. more than the .c?
21:35:00 <x8dcc> don't think so
21:36:00 <heat> your heap doesn't actually expand
21:36:00 <x8dcc> my heap is trash
21:36:00 <x8dcc> everything is trash
21:36:00 <heat> you also have no way of allocating physical pages
21:36:00 <heat> i'm giving you ideas pal
21:36:00 <heat> if they're trash, make em good
21:36:00 <zid> heat when are you adding an allocator to my kernel
21:36:00 <heat> when are you giving me a back rub?
21:37:00 <zid> I figured you'd want to give ME a back rub
21:37:00 <x8dcc> I don't even know why I would need to expand my heap or to allocate physical pages
21:37:00 <heat> why would i give peter crouch a back rub
21:37:00 <x8dcc> it's a bit frustrating
21:38:00 <zid> cus getting to touch footballers is your life goal?
21:38:00 <heat> if crouchy gave me a back rub he'd still be touching me
21:38:00 <heat> hence i win
21:38:00 <heat> x8dcc: dynamic memory allocation
21:38:00 <heat> for... dynamism?
21:38:00 <zid> getting touched and someone else allowing you to touch them are deeply different
21:39:00 <heat> like, you can roll with the old-ass UNIX struct inode inos[NINODES]; and then allocate from that, and panic if you run out
21:39:00 <heat> but that's old-ass and bad
21:40:00 <x8dcc> idk, this whole FP thing demotivated me for real
21:40:00 <heat> why
21:41:00 <x8dcc> well it was something I wanted to fix for months and turns out it was for nothing
21:41:00 <x8dcc> I know it's my fault but still sad
21:56:00 <heat> going on wild goosechases is like osdev 101
21:56:00 <heat> it happens
21:56:00 <kazinsal> yep
21:56:00 <kazinsal> that's like, 90% of the hobby
21:57:00 <zid> It's literally some people's jobs to contribute to linux, they spend 2 years writing some big patchset
21:57:00 <zid> and it gets rejected
21:58:00 <x8dcc> I guess I would be sad there as well
21:58:00 <x8dcc> but yeah, I get it happens
21:58:00 <x8dcc> so anyway, what do you think I should work on next for userspace?
21:58:00 <zid> I already said it
21:58:00 <heat> page allocation
21:58:00 <heat> then a proper heap
21:59:00 <heat> like copy the slab allocator paper or something
21:59:00 <zid> heat refuses to give me a shitty proper heat :(
21:59:00 <heat> then get a proper scheduler
21:59:00 <zid> heap*
21:59:00 <zid> heap: write me a shitty heat
21:59:00 <heat> heatp
21:59:00 <heat> brkbrkbrkbrkbrkbrkbrk
21:59:00 <x8dcc> what is exactly page allocation for?
21:59:00 <heat> paging
22:00:00 <heat> but in page aligned page-sized chunks
22:00:00 <heat> it's like dynamic allocation but in pages
22:00:00 <samis> sbrksbrksbrksbrksbrk
22:01:00 <heat> like, sbrk asks for memory, you map some pages
22:01:00 <zid> I have that bit
22:01:00 <heat> or the slab allocator needs more slabs, you ask for pages from the alloc
22:01:00 <zid> I want a PROPER HEAP
22:01:00 <heat> then one may think "oh hrm this page thing is a really adequate and useful unit for memory allocation sometimes"
22:02:00 <x8dcc> heat: hmm okay, I see. I guess I can look more into that
22:02:00 <x8dcc> thank you
22:02:00 <heat> so you get allocators asking for pages, caches caching files in page units (page cache??)
22:02:00 <heat> np
22:03:00 <heat> the page is the basis of everything in a kernel
22:03:00 <heat> ever noticed how PATH_MAX is 4096, the common size of a page?
22:04:00 <x8dcc> I hadn't noticed, to be honest
22:06:00 <heat> normal people dont notice PATH_MAX yeah
22:38:00 <heat> everyone asks what is PATH_MAX but no one asks how is PATH_MAX :(
23:26:00 <gog> how is PATH_MAX
23:26:00 <zid> fine thanks how is /etc/shadow
23:35:00 <gog> mysterious
23:35:00 <zid> Shadow is my edgelord name.
23:35:00 <zid> Etc Shadow.
23:38:00 <gog> i don't want to be an edgelord anymore
23:38:00 <gog> i want to be a normal person with normal thoughts
23:38:00 <zid> But what happens if the seal in your left eye fails and nobody knows you have it!?
23:38:00 <gog> what
23:39:00 <zid> -> evil eye types
23:39:00 <bslsk05> ​ Chuunibyou - TV Tropes
23:41:00 <gog> oh
23:41:00 <gog> that is me though
23:42:00 <zid> I should watch more of that chuuni girl series
23:42:00 <zid> she calls dr pepper a mana potion that's all I remember of the first ep that I watched
23:42:00 <gog> i'm not a very good or smart person tbh
23:42:00 <gog> and i need to fluff myself up to seem better
23:43:00 <zid> have you considered that
23:43:00 <zid> most people are way shitter than you think you are
23:43:00 <zid> and you're actually like 80th percentile
23:47:00 <zid> wtb more crappy light novels
23:49:00 <zid> oh, something new came out 30 mins ago, Love under the Blue Moon - Falling in love again.. ehhh..
23:49:00 <zid> guess I am reading this!
23:52:00 <gog> i should go to bed now