klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
qxz2 has quit [Server closed connection]
nyah has quit [Quit: leaving]
JerryXiao has quit [Server closed connection]
JerryXiao has joined #osdev
tixlegeek has joined #osdev
tixlegeek has quit [Quit: tixlegeek]
qbasiq has joined #osdev
netbsduser has quit [Ping timeout: 248 seconds]
tanto has quit [Server closed connection]
tanto has joined #osdev
gruetzkopf has quit [Server closed connection]
gruetzkopf has joined #osdev
heat has quit [Quit: Client closed]
goliath has quit [Quit: SIGSEGV]
Turn_Left has quit [Read error: Connection reset by peer]
stolen has joined #osdev
duderonomy has joined #osdev
eau has quit [Ping timeout: 245 seconds]
eau has joined #osdev
Yoofie has quit [Read error: Connection reset by peer]
Yoofie has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
zid has quit [Server closed connection]
zid has joined #osdev
lav has quit [Server closed connection]
lav has joined #osdev
joe9 has quit [Quit: leaving]
hrberg has joined #osdev
SGautam has joined #osdev
Burgundy has joined #osdev
ThinkT510 has quit [Quit: WeeChat 4.0.3]
ThinkT510 has joined #osdev
cross has quit [Server closed connection]
cross has joined #osdev
Burgundy has quit [Ping timeout: 246 seconds]
Griwes has quit [Server closed connection]
Griwes has joined #osdev
andreas808 has quit [Ping timeout: 246 seconds]
Left_Turn has joined #osdev
tixlegeek has joined #osdev
Hammdist has quit [Quit: Client closed]
GeDaMo has joined #osdev
gog has joined #osdev
tixlegeek has quit [Quit: tixlegeek]
tixlegeek has joined #osdev
vancz has quit []
pie__ has quit []
tanto has quit [Quit: Adios]
vancz has joined #osdev
tanto has joined #osdev
pie_ has joined #osdev
[itchyjunk] has joined #osdev
tixlegeek has quit [Quit: tixlegeek]
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
netbsduser has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 246 seconds]
<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?
phr3ak has quit [Server closed connection]
tixlegeek has joined #osdev
<netbsduser> nortti: yes, exactly that
<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
<nortti> and I guess linear page tables were for simplicity of implementation?
<netbsduser> i think it would´ve been specifically for the simplicity of implementing pageable user page tables
exark has quit [Server closed connection]
exark has joined #osdev
nur has quit [Server closed connection]
nur has joined #osdev
tixlegeek has quit [Quit: tixlegeek]
goliath has joined #osdev
andreas303 has joined #osdev
heat has joined #osdev
<zid> hello feet
tixlegeek has joined #osdev
utzig has quit [Server closed connection]
utzig has joined #osdev
eddof13 has joined #osdev
tixlegeek has quit [Quit: tixlegeek]
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 245 seconds]
troseman has joined #osdev
tixlegeek has joined #osdev
<heat> gello
pounce has quit [Ping timeout: 246 seconds]
pounce has joined #osdev
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Turn_Left has joined #osdev
<mcrod> hi
Left_Turn has quit [Ping timeout: 260 seconds]
PublicWiFi has quit [Server closed connection]
PublicWiFi has joined #osdev
<Ermine> heat: how do you feel yourself
<heat> i feel like ass
<heat> at least i feel better than yesterday morning but that's a low point innit
<heat> still have issues eating but im kinda hungry
<heat> dreamed about eating kitkats ngl best dream ever
<Ermine> that sucks
<heat> it does but At Least Im Not Puking
<heat> And Im Watching The Footy
Bonstra has quit [Server closed connection]
Bonstra has joined #osdev
woky_ has quit [Server closed connection]
woky has joined #osdev
dude12312414 has joined #osdev
dormito has quit [Server closed connection]
dormito has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<gog> HI I'M SAD
* kof123 .oO( innit init system )
<gog> and i'm doing capslock by accident
<kof123> why are you sad gog?
<Cindy> gog: hi sad i'm sad
* ChavGPT hugs gog
<ChavGPT> there there
<heat> gog: SAD is actually a type of company here in portugal
eddof13 has joined #osdev
<Ermine> gog: may I pet you
<gog> hi
<gog> yes
<gog> probably nothing idk
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
joe9 has joined #osdev
heat has quit [Quit: Client closed]
eddof13 has joined #osdev
qbasiq has quit [Ping timeout: 246 seconds]
stolen has quit [Quit: Connection closed for inactivity]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troseman has quit [Quit: troseman]
Hammdist has joined #osdev
Hammdist has quit [Ping timeout: 246 seconds]
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
xenos1984 has quit [Ping timeout: 258 seconds]
tixlegeek has quit [Quit: tixlegeek]
xenos1984 has joined #osdev
tixlegeek has joined #osdev
agent314 has joined #osdev
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
qbasiq has joined #osdev
x8dcc has joined #osdev
heat has joined #osdev
agent314 has quit [Ping timeout: 250 seconds]
agent314 has joined #osdev
<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?
<heat> erm
<heat> maybe?
<heat> so, it's kinda useless
<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
<bslsk05> ​github.com: Onyx/kernel/arch/x86_64/fpu.cpp at master · heatd/Onyx · GitHub
<heat> if everything else in the FPU area is zeroed you have an EZPZ FPU SQZ
qxz2 has joined #osdev
<x8dcc> that's helpful, I will do that instead
sympt has quit [Server closed connection]
<x8dcc> thank you :)
sympt has joined #osdev
<heat> np
troseman has joined #osdev
<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
<geist> but i think some of the wonkiness is because of the zero-is-default-state mechanic
Matt|home has joined #osdev
<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
<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
<geist> though i guess the radix tree style page table also accomplishes fairly the same thing
<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
<geist> seems like the kernel aspace would start getting pretty cramped with page tables by then
<nortti> how big is a page table entry on VAX?
<geist> 4 bytes, fairly standard set of fields by modern standards
<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
<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
<samis> that's why VMS has a number of rings and unlike x86 actually uses them
<samis> right?
<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
<nortti> hm, OS/2 used rings for device drivers on 80286, right? what did it do for 386?
<geist> i think OS/2 was the main user of rings, yeah
<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
<geist> how that really gets you much protection since the paging scheme only gives you 2 i dunno
<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
<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
<geist> pretty educational
<zid> or forgeddaboutit
<zid> it's 2023 baby, 64bit virtual address spaces for everyone
<nortti> does any CPU architecture actually give 64 bits of virtual address space?
<zid> Not sure actually
<nortti> afaict 39, 48, and 56 seem like the common values
<zid> "48 is the best I can do" --CPU makers
<geist> fairly sure ia64 does
<nortti> oh, interesting
<nortti> does it just do a deeper radix tree?
<geist> iirc it chops the full virtual space into 8 separate zones, each zone has it's own paging structure
<geist> so you can use that however you want, 2:2, 7:1, 1:6:1, etc
<geist> so each paging structure deals with 2^61 of it
<geist> but basically that means you have up to 8 things to context switch
<geist> depending on how you choose to use it
<geist> and no ia64 does not use a radix tree at all, it's a very very different design
<geist> closer to POWER/PPC but it has two modes that you can choose per structure iirc
<geist> basically part of the control register set up
<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
<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
<geist> i think those page table entries are 16 bytes long, iirc
<geist> been a while, actually heat grokked it all at once
<geist> ITAAAAANIUM
<heat> ITAAAAAAAAAAAAAANIUUUUUUUUUUUUUUUUUUUUM
<heat> nortti: don't forget 36 btw, afaik 36 is also pretty common
<heat> hm sorry 36 bits seemsto be common for a physical address
<heat> also it's 57
<heat> you go 48 -> 57 cuz of 9 extra bits
<heat> and on ARM, 49 -> 58
<heat> IF they have 58-bit addressing, which I don't think they do?
<childlikempress> I thought arm had a 52-bit thing?
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<heat> (ARM has an extra bit because it has two radix trees instead of one)
<heat> idk, probably
<heat> i don't remember all the details, i just did 48-bit
<heat> *49
<netbsduser> interestingly the VMS port to Alpha was done by implementing a vax macro assembly 2 alpha compiler
<heat> good
<heat> what a great solution
<heat> up yours dave cutler
xelxebar has quit [Server closed connection]
xelxebar has joined #osdev
<childlikempress> remember #define rax x0 from apple or whatever it was
<heat> with all the registers arm has you could even define-emulate MMX
Arthuria has joined #osdev
<heat> imagine the possibilities
troseman has quit [Quit: troseman]
<childlikempress> ooh I just realised something
<childlikempress> the x87 stack has 8 elements
<childlikempress> so you can shove the entire thing into an avx512 register and emulate the stack ops with shuffles
<gog> RYYYYYZEN
troseman has joined #osdev
<heat> thank you childlikempress, very cool!
<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 :(
<heat> then something else is wrong
<heat> because That Just Works(tm)
<x8dcc> rest of the 512 bytes are zeros
<x8dcc> the exception occurs on a fstp instruction
SGautam has quit [Quit: Connection closed for inactivity]
<kof123> one small step for x87, one giant leap towards pages in registers
<heat> wait
<heat> why the fuck do you have x87 instructions?
<x8dcc> not sure
<childlikempress> kof123: the avx512 state is 2kb
<childlikempress> and an avx512 instruction has a 2-bit register size header whose meanings are: 16 bytes, 32 bytes, 64 bytes, unassigned
<childlikempress> SO they could double the register size still, and literally store a page in registers
<childlikempress> HTH.HAND
<heat> oh, 32-bit codegen uses x87 by default
<heat> ew
<childlikempress> -msse or sth
<childlikempress> or just do 64 bit
<heat> x8dcc: did you configure the FPU properly
<heat> where are you catching this exception? hopefully not the kernel?
<x8dcc> I think I configured fpu properly, but I usually my errors happen because I think I did something right when I didn't
<x8dcc> childlikempress: I use -msse and -msse2 currently
<heat> where
<heat> what is crashing?
<x8dcc> my %f format for printf
<x8dcc> and I only have kernel, I don't have userspace or anything
<heat> oh god
<heat> don't
<x8dcc> I haven't touched the project in some months
<heat> rm -rf %f handling
<heat> and then rm -rf -msse -msse2 from your kernel's CFLAGS
<childlikempress> don't do fp in kernel
<x8dcc> well I don't have anything else haha
<zid> afaik in linux to do fp you have to call a special lock + init function, do your shit, then release?
<zid> and it's only used by like, the crypto api
<x8dcc> childlikempress: why is it bad to use fp in kernel?
<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)
<zid> -mgeneral-regs-only for life
<zid> Then never bother to make a libgcc, so that if you ever need one it fails to link
<childlikempress> yeah that was it
<childlikempress> no why what's wrong with libgcc
<zid> it'll have the float cast etc code in it
<childlikempress> oh
<heat> x8dcc: floating point sucks, and you'll need to consistently save/restore FPU regs after kernel entries and exits
<heat> which is expensive
<x8dcc> well that's a bit depressing
<heat> why?
<x8dcc> because I spent a lot of time trying to fix stuff related to this for nothing
<x8dcc> but whatever
<zid> fairly sure you were told not to last time too
<x8dcc> don't remember, but you might be right
<x8dcc> learned in the process so I don't mind that much
<childlikempress> I mean tbf it _should_ work, since you're not actually doing any context switching (I presume)
<bslsk05> ​godbolt.org: Compiler Explorer
<childlikempress> so it is a bit suspicious
<zid> you still need to enable floating point in the control reg and stuff
<childlikempress> that it doesn't. But still, shouldn't, so
<zid> and make sure it generates the right alignments etc
<heat> i can't convince 32-bit gcc to FPU using SSE
<heat> zid: and actually load the mxcsr/fxsave state
<zid> is that not what I said
<heat> no you just mentioned the control regs
<childlikempress> heat: -mfpmath=sse
<bslsk05> ​github.com: Onyx/kernel/arch/x86_64/fpu.cpp at master · heatd/Onyx · GitHub
<zid> Loads the source operand into the MXCSR control/status register.
<zid> control register.
<heat> ok
<x8dcc> well what should I work on next
<zid> 802.11b
<childlikempress> can you allocate memory
<heat> childlikempress: ew fpmath=sse generates horrendous code
<x8dcc> yes I can
<childlikempress> i suggest being able to allocate memory
<heat> for the float func at least
<x8dcc> I spent a lot of time
<childlikempress> heat: it has to return on x87 because of the abi
<zid> I spent hardly any time on mine it's awful <3
<childlikempress> try void f(float *x) { *x += 10; }
<x8dcc> I mean a lot of time adding alignment for allocations for fxsave
<x8dcc> for nothing (for now)
<zid> you'll want a userspace libc though?
<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
<zid> you'll -> you will
<zid> future tense
<zid> You just wrote it early is all
<x8dcc> yeah I know
<x8dcc> still, I think it's missing whatever it is that separates libk from libc :)
<heat> have you considered getting to userspace?
<zid> my userspace is amazing isn't it heat
<heat> yes
<heat> high quality
<heat> emulators
<zid> 0 syscalls
<zid> recompile entire kernel to change the userspace program
<x8dcc> heat: sure, but I don't really know where to start
<zid> I just shipped a binary with my kernel, mapped it cpl3 at 2M
<zid> and iret'd the kernel to it
<heat> x8dcc: what do you have?
<zid> can build from there
<x8dcc> I saw that, zid
<zid> timer to bring you back to kernel, filesystem to let you pick an /init, etc
<zid> good excuse to add APs afterwards also
<gog> hi
<gog> i don't program kernal
<zid> web development gives a wage
<zid> so that's understandable
<x8dcc> heat: not sure what to tell you, you can kinda guess by the filenames in the kernel dir, I guess
<heat> what kernel dir?
<x8dcc> hard to say what I have because I am not sure what I need/am missing
<x8dcc> heat: meant src/kernel/*.c
<heat> i don't know what your OS is
<heat> sorry
<bslsk05> ​github.com: fs-os/src/kernel at main · fs-os/fs-os · GitHub
<zid> I have also not seen a single line of it
<x8dcc> I sent the link some months ago, I am sure of that
<zid> that'll be why
<zid> you also have a non-name name
<zid> for both irc and github
<zid> so it's hard to remember you/it between the month breaks
<x8dcc> the most important commit was made by heat
<x8dcc> zid: I understand, I don't mind
<heat> why do you have so many fucking commits holy shit
<x8dcc> I change stuff, I guess
<zid> rebase -i it down to about 3
<heat> they're wayyyyyyyy too granular pal
<x8dcc> I am sorry
<zid> meh they seem fine
<zid> It's just they would normally be hidden behind merges, or be part of a series
<zid> I don't like the lack of title style
<x8dcc> what?
<zid> "Align task stack to 16 bytes" -> "task/stack.c: Align stack to 16 bytes"
<bslsk05> ​github.com: fs-os/src/kernel/multitask.asm at main · fs-os/fs-os · GitHub
<zid> and then that'd normally be part of a small series of fixes that got 'merged'
<x8dcc> zid: I see
<zid> so you'd end up with [01/05] task: fix a, [02/5] task: fix b
<zid> etc
<zid> and you get a nice sort of visual grouping going on
<x8dcc> I get anxious when I have too many uncommited changes
<zid> so commit them?
<zid> You don't have to push before you rebase
<heat> your kernel should have way less asm
<zid> my locak tree is usually [master] then [wwwwww] [wasdf] [asdeir]
<zid> :D
<x8dcc> heat: Why does it matter
<zid> with commits on each branch that are 'fopd' 'asdasd'
<heat> unreadable, unportable, hard to extend
<x8dcc> zid: I honestly have to admire that
<zid> x8dcc: why not write it all in asm?
<zid> take whatever you're about to say as your answer
<zid> and apply it to the bits of asm in your code
<zid> done
<x8dcc> I like asm, but the entire thing would take too much time
<zid> that is infact, a fuck load of files ending in .asm
<zid> is that.. more than the .c?
<x8dcc> don't think so
<heat> your heap doesn't actually expand
<x8dcc> my heap is trash
<x8dcc> everything is trash
<heat> you also have no way of allocating physical pages
<heat> i'm giving you ideas pal
<heat> if they're trash, make em good
<zid> heat when are you adding an allocator to my kernel
<heat> when are you giving me a back rub?
<zid> I figured you'd want to give ME a back rub
<x8dcc> I don't even know why I would need to expand my heap or to allocate physical pages
<heat> why would i give peter crouch a back rub
<x8dcc> it's a bit frustrating
<zid> cus getting to touch footballers is your life goal?
<heat> if crouchy gave me a back rub he'd still be touching me
<heat> hence i win
<heat> x8dcc: dynamic memory allocation
<heat> for... dynamism?
<zid> getting touched and someone else allowing you to touch them are deeply different
<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
<heat> but that's old-ass and bad
<x8dcc> idk, this whole FP thing demotivated me for real
<heat> why
<x8dcc> well it was something I wanted to fix for months and turns out it was for nothing
<x8dcc> I know it's my fault but still sad
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
linear_cannon has quit [Remote host closed the connection]
linear_cannon has joined #osdev
<heat> going on wild goosechases is like osdev 101
<heat> it happens
<kazinsal> yep
<kazinsal> that's like, 90% of the hobby
<zid> It's literally some people's jobs to contribute to linux, they spend 2 years writing some big patchset
<zid> and it gets rejected
<x8dcc> I guess I would be sad there as well
<x8dcc> but yeah, I get it happens
<x8dcc> so anyway, what do you think I should work on next for userspace?
<zid> I already said it
<heat> page allocation
<heat> then a proper heap
<heat> like copy the slab allocator paper or something
<zid> heat refuses to give me a shitty proper heat :(
<heat> then get a proper scheduler
<zid> heap*
<zid> heap: write me a shitty heat
<heat> heatp
<heat> brkbrkbrkbrkbrkbrkbrk
<x8dcc> what is exactly page allocation for?
<heat> paging
<heat> but in page aligned page-sized chunks
<heat> it's like dynamic allocation but in pages
<samis> sbrksbrksbrksbrksbrk
<heat> like, sbrk asks for memory, you map some pages
<zid> I have that bit
<heat> or the slab allocator needs more slabs, you ask for pages from the alloc
<zid> I want a PROPER HEAP
<heat> then one may think "oh hrm this page thing is a really adequate and useful unit for memory allocation sometimes"
<x8dcc> heat: hmm okay, I see. I guess I can look more into that
<x8dcc> thank you
<heat> so you get allocators asking for pages, caches caching files in page units (page cache??)
<heat> np
<heat> the page is the basis of everything in a kernel
<heat> ever noticed how PATH_MAX is 4096, the common size of a page?
<x8dcc> I hadn't noticed, to be honest
<heat> normal people dont notice PATH_MAX yeah
Burgundy has joined #osdev
[itchyjunk] has quit [Ping timeout: 246 seconds]
\Test_User has quit [Quit: e]
<heat> everyone asks what is PATH_MAX but no one asks how is PATH_MAX :(
\Test_User has joined #osdev
[itchyjunk] has joined #osdev
LittleFox has quit [Server closed connection]
LittleFox has joined #osdev
Matt|home has quit [Quit: Leaving]
<gog> how is PATH_MAX
<zid> fine thanks how is /etc/shadow
energizer has quit [Server closed connection]
<gog> mysterious
<zid> Shadow is my edgelord name.
<zid> Etc Shadow.
<gog> i don't want to be an edgelord anymore
<gog> i want to be a normal person with normal thoughts
energizer has joined #osdev
<zid> But what happens if the seal in your left eye fails and nobody knows you have it!?
<gog> what
<bslsk05> ​tvtropes.org: Chuunibyou - TV Tropes
Turn_Left has quit [Read error: Connection reset by peer]
<gog> oh
<gog> that is me though
<zid> I should watch more of that chuuni girl series
<zid> she calls dr pepper a mana potion that's all I remember of the first ep that I watched
<gog> i'm not a very good or smart person tbh
<gog> and i need to fluff myself up to seem better
<zid> have you considered that
<zid> most people are way shitter than you think you are
<zid> and you're actually like 80th percentile
<zid> wtb more crappy light novels
<zid> oh, something new came out 30 mins ago, Love under the Blue Moon - Falling in love again.. ehhh..
<zid> guess I am reading this!
<gog> i should go to bed now
gog has quit [Quit: byee]