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
<kazinsal> yeah, his talk about how ISA doesn't really matter *that* much anymore was great
<zid> good sign that the top of the company doesn't think the 80s risc vs cisc thing is relent :p
<zid> relevent*
anon16_ has quit [Read error: Connection reset by peer]
<geist> Yeah, i generally came to the isa doesn’t matter realization a while back, but mostly because of a series of articles about 10 years ago on arstechnica
<zid> cache solves all ills
<geist> It matters mostly in the IP, tooling, software ecosystem part of it
<moon-child> oisc considered sufficient for all real-world purposes
<geist> And of course you need at least a basically well designed isa. Obviously there are limits
<zid> fuz likes to post diatribes to reddit on this stuff
anon16_ has joined #osdev
<zid> I should find one :P
<moon-child> obviously isa _matters_. Otherwise no one would make vector isas. Just doesn't matter as much as people think
<moon-child> geist: yea
<geist> But honestly I don’t care about Isas as much as i like the system mode side of it
<zid> Even with a bad isa, one good instruction that lets you do THE TASK you wanna do with it, it'll be fine
<geist> Ie, control registers, supervisor mode, mmu, etc etc
<geist> That’s what i get my kicks on
<geist> Though of course they tend to be 1:1 associated
<zid> I like amd's ISA though to be fair, just need intel fred to fix it :p
<geist> The new tlb flush stuff makes me excite
<geist> But slightly less so sinceit’s virtually identical to the ARM64 tlb flush stuff
<zid> is that part of fred or something new?
<geist> It’s already in zen 3, kinda a quiet feature (since who thinks about TLB flushes except folks like us)
<zid> I mean, fred made reddit somehow
<moon-child> because linus torvalds made a Comment about
<moon-child> it
<geist> Linus hath spake
<zid> guess that helps
<geist> Did he hate on it?
<zid> given they had swapgs exploits, I doubt it
<zid> my cpu's still exploitable with pop ss I think
<geist> The Fred stuff looks fine to me. A better solution than AMDs new suggested syscall cleanup which is much more conservative
<kazinsal> fifty-fifty if torvalds hates something it's actually good
<geist> Yah i dunno if he has much love for x86 anymore (or ever did)
<geist> Actually dunno if he has much love for any particular ISA. Has he ever shown interest in arm64 or riscv or whatnot?
<zid> he likes things that make his job easier and dislikes things that make it harder
<geist> And likes scuba
<zid> so it's not hard to figure out which side he comes down on
<zid> nvidia fuck everybody around -> fuck nvidia
<geist> kazinsal: unrelated: did you get any rain?
<geist> Yay rain. It’s so goddamn dry this summer
<kazinsal> yep, yesterday was drizzling on and off
<zid> I'd trade all sorts of unsanitary activies for some thunder
<kazinsal> bit cloudy today but otherwise still fairly warm and sunny
<geist> Omg was in canada last week and we had a crazy epic thunderstorm sweep through, with a whole wall cloud and everything
<geist> was super neat. Haven’t seen something like that in years
<kazinsal> yeah don't get much of that out on the Best Coast
<geist> Pretty much
<geist> That being said i really do like overcast
CryptoDavid has quit [Quit: Connection closed for inactivity]
<zid> come to cambridgeshire
<geist> Actually sitting outside in it right now. Basking in the indirect lighting
<zid> I've not seen the sky in 20 years
<geist> Yeah but it also gets mega hot there
<geist> I’ve visited a few times and it’d get up to like 35
<zid> that was unlucky
<geist> And humid
<zid> That's like.. 3 days a year
<zid> and only in the past decade
<geist> Yah arm always picks the worst day to have their APM
<geist> Back in the Before Times
<kazinsal> yeah I'm one of those people who can do humid *or* hot but not both
<zid> all the marshland round here just generates clouds all day
<zid> it's a cloud factory
<zid> no thunder though it always avoids us :(
<geist> Didn’t know you were around Cambridge
<zid> I'm not really
<zid> just in the county
<geist> Well, i figure with a country as small as UK being in the same county is pretty much the same thing
<zid> travel is still fractal
<geist> But i dunno how big the counties are
<zid> I'd need to bus to city, train to cambridge, bus to where I anna go
<geist> Yah though they have that train to London, which if it’s running isn’t too bad
<geist> that’s usually what i do when i visit
<geist> Never took it north but I don’t think it really goes anywhere
<zid> Train goes straight to london form the city, the line's over on my side
<geist> Just to the NE coast
<zid> Great eastern line or whatever it's called
<geist> And it’s funny all the locals apologize profusely about their terrible train system
<geist> And I’m like, shit this is great
<zid> It's expensive and spotty
<geist> You can get on a train and go somewhere meaningful!
<zid> but it exists
<zid> canadians/americans can't design cities so it's probably a notable upgrade for you
<geist> Yah actually i failed me once and i had to get an Uber to ride back
<geist> In 2019 there was some huuuuge power failure in like half the country
<geist> and it took out the line while i was in London
<geist> Hah don’t lecture about designing cities when you have London
<kazinsal> if you could meaningfully bridge vancouver and seattle by high speed train I'd be all over that shit
<zid> typical londoner, thinking some of london is half the country
<zid> You don't get to say shit with your stroads
<geist> More like ‘london is a total disaster’ as far as any sort of coherent design
<geist> Probably second only to Tokyo
<zid> cities don't really need designing, they just need to not make zoning a corner shop illegal like all of the US does
<geist> That’s very spotty in lots of cities. I grew up near Houston which has *no* zoning
<zid> everybody has to drive from their minimum acreage single family unit to the city to do anything, roads have to be 18 lanes wide, etc
<kazinsal> the town I live in has finally discovered that it's okay to zone high rises
<geist> It’s just a total disaster of clusters of skyscrapers and random ghettos
<zid> houston has minimum lot size + single family lot only rules
<zid> exactly like everywhere else in the US
<geist> Yeah but the commercial/residential zoning is all over the place
<geist> You have all of these decentralized downtowns
<zid> That sounds like it'd help a little at least
<bslsk05> ​'Why City Design is Important (and Why I Hate Houston)' by Not Just Bikes (00:17:02)
<geist> Yah stuff like getting around is basically car-only
<geist> Though i havne’t been there in 20 years so i may have improved
<geist> I do hear that people actually live downtown nowadays
<geist> Which was just not a thing 30 years ago
<zid> 45 sec into that video, the sunnyvale helicopter shot
<zid> that's what all american cities look like because of those zoning rules
<zid> and why the roads are all 18 lanes wide
<geist> Heh and he’s walking around the Willobrook area in Houston
<geist> That’s where i spent a lot of my youth. Was the closest mall with a proper theater, etc
<geist> You’d get in a car to drive across the parking lot
<zid> This entire series is great, if you have the time
<zid> and want to end up hating US infrastructure
<geist> Also because i might be 110F and 90% humidity
<geist> My theory is the most interesting cities, at least in the US, are land locked
<geist> So they are forced to stay centralized and grow upwards and denser
<zid> It has awful knock-off effects that he covers elsewhere too, like the land being super low density and costing a fortune to maintain the water and roads for
<geist> Or you get a Dallas or Houston or phoenix where there’s nothing that keeps it from sprawling
<zid> so cities were just building more houses and selling them to pay for maint on the stuff they already had, and now places are starting to explode from the debt
<klange> geist: You mean the least interesting cities are land-locked? Landlocked means surrounded by land.
<geist> Water locked i guess
<zid> And if it rains, waterlogged? :P
<geist> Funny I’ve been saying that for years and no one has corrected me, but you’re right Lange
<geist> I’ve been using the wrong phrase all this time.
<geist> I mean locked into a smallish area. Can’t expand. Usually water or mountains
<zid> That's because they have to zone it properly or it won't even function at a basic level
<geist> (Also sorry the stupid ipad keeps autocorrecting)
<zid> plus you get some scenery
<klange> Tokyo is somehow both at the same time.
<klange> We're on a bay, but we keep building out into it with artificial islands and other landfill.
<kazinsal> yeah, vancouver's got water on one side, mountains on another, and, worst and most nefarious of all
<zid> canadians
<kazinsal> the united states on another
<klange> America!
<zid> That's my problem with France
<geist> SF, nyc, Seattle at least are mostly stuck sizewise
<zid> Nice place, that they ruined by filling with french people
<geist> Chicago is all crammed up against the water, but nothing keeps it from expanding west
<kazinsal> yeah seattle's expansion in the past 20 years or so has just been filling in the gaps between the city and everett and the city and tacoma
<kazinsal> but other than, up rather than out
<geist> Yeah. For better or worse they were really pushing a lot of the ‘up’ the last 10 years
<geist> Re-zoning a bunch of stuff to avoid the SF problem where they refuse to re-zone anything
<geist> Since it would kill the character of the city
<geist> Or so they say
<kazinsal> yeah, up here you've got a slightly different issue where "vancouver" is really a dozen different municipalities
<geist> Do you want people to live there or be a Disneyland town?
<kazinsal> all with different governance and zoning strategies
<geist> Yah. That’s what a lot of the Bay Area is. Once you get down into the peninsula there are tons of cities and they just pass the buck to the next town over
<geist> Build more commercial, no residential
<geist> Though San Jose screwed up and long time ago filled all of their space with green color and have no blue color
<geist> No tax revenue
<zid> brb need THE DRUGS, my bumhole is falling off
<klange> That sounds unpleasant.
<geist> Heading down to the milk bar
<geist> Need a bit of ultraviolence to take the edge off
<klange> It is Monday morning and time for work here.
<klange> Unrelatedly, I have fixed up a pretty big /* TODO */ and am now actually bothering to parse memory maps and can support 64 gigabytes of memory, yay.
<geist> Oh woot
<geist> I forget how much qemu can emulate but i think if you map memory to a sparse file you can actually test that
<geist> Provided you don’t actually fill it in, or you have a spare TB or two floating around
<kingoffrance> its a state of mind zid https://www.smbc-comics.com/comic/france
<geist> Heh
<zid> wish I were joking, I have a cyst on my ass cheek and I can't stand up or sit down
<zid> slamming ibuprofen and showering in lidocaine
<moon-child> zid: thanks for letting me know
<moon-child> I always want to know the state of your ass
<zid> np
<zid> If you want me to shut up you can get me an assectomy
no-n has joined #osdev
rasjaremoc has joined #osdev
<rasjaremoc> Altera guys are way more smarter than any of the current cpu manufacturing companies employees or employers. Last who are not perhaps so big jokes as you, but still pretty mad people. You are wank professors and terrorists in america mostly.
<rasjaremoc> this is pretty different than a tech person is or mensa club member.
rasjaremoc was banned on #osdev by klange [*!*reidas@221.156.88.*]
rasjaremoc was kicked from #osdev by klange [rasjaremoc]
pretty_dumm_guy has quit [Quit: WeeChat 3.2.1]
anon16_ has quit [Ping timeout: 252 seconds]
anon16_ has joined #osdev
<klange> In my endless journey of working on things that aren't even on my TODO list, I think I should write an MP3 decoder. I have a packaged build of minimp3, which is a stripped-down version of the ffmpeg mp3 decoder. MP3 patents are fully expired by now.
<zid> sounds fun, I hate audio though
<zid> so as long as I don't have to actually /play/ it, that's fine
<klange> I hate audio, too, but I have a sufficient stack that works okay. If I'm going to do audio stuff, it really _should_ be getting an HDA driver so I can actually play stuff on my laptop, but HDA had to sacrifice a lot of simplicity in order to be a universal standard for computer audio equipment.
<zid> mixing is voodoo
<zid> and so is resampling
<zid> as long as I'm just turning "audio in file to PCM it represents in a char[]" I'm happy
<klange> _Good_ mixing and resampling are voodoo.
<zid> I don't know enough of the dark magic to know how badly I am doing it is the problem
<klange> Sufficient mixing and resampling are very simpler. One is just addition, the other is just some multiplication and division.
<zid> I don't trust myself not to think "this is perfect"
<moon-child> there's a pdf on ccrma website somewhere describing the mathematically ideal resampling algorithm
<moon-child> I got lost somewhere in the middle. Gave up and did lerp
<klange> [In a rare instance where "we" is appropriate because I was not the one who built the original audio stack for ToaruOS] We have an in-kernel mixer in ToaruOS that does the bad thing.
<moon-child> might switch to a quad or cubic thingy later though
<zid> I'm still putting off doing audio on my gameboy emulator, it needs to output 44kHz or whatever but technically you can fiddle the MMIO at 1MHz instead and need to do all sorts of crazy resampling inside the mmio access
Izem has joined #osdev
<zid> 440kHz toggle = 44KHz 0.5 or whatever
<zid> and you can't just run the audio at 1MHz and resample it because then it's super cpu intensive and slightly laggier, etc
<zid> voodoo and I shall take no part in it
<klange> This is the horrible little resampler in Toaru's Doom audio backend: https://github.com/klange/doomgeneric/blob/master/doomgeneric/i_toarusound.c#L108
<bslsk05> ​github.com: doomgeneric/i_toarusound.c at master · klange/doomgeneric · GitHub
<zid> wanna give it a go klange? I'll write your mp3 decoder :p
johnjay has quit [Ping timeout: 260 seconds]
<moon-child> Gah! That's not even lerping, it's just replicating the samples!
<moon-child> ._.
<klange> What's really fun is how that backend handles playing multiple sounds.
<moon-child> do I want to look?
<klange> It just opens multiple connections to the kernel mixer and plays one sound per connection.
<moon-child> !
no-n has left #osdev [WeeChat 2.8]
<moon-child> wait, so...latency for playing a sound involves creating a new connection to the kernel mixer!
<zid> klange.dev so slow, is that just japanese peering, or is it your residental interweb connection
<klange> klange.dev is hosted on a VPS in San Francisco
<zid> so bad SF peering
<Mutabah> not noticably slow for me
<klange> Possibly. It's not that slow for me. Slow enough I run a local mirror for my package manager, but ain't nobody got time to wait for gcc to download over the Internet when it takes a second or two locally.
<klange> I am probably way happier than I should be about my speed to the VM host... an amazing 300mbps!
<zid> I wonder if it's a cipher issue or something, it's super fast in cURL
<zid> It's *still* loading, in firefox
<zid> firefox using.. aes-gcm 128bit, tls 1.3
<zid> yea this is super weird
<klange> I keep forgetting that I wanted to replace the remaining time with the total time taken in this progress printout... https://klange.dev/s/vbox_300mbps.png
<zid> why not both!
Izem has quit [Ping timeout: 265 seconds]
<klange> I mean when it finishes instead of sayin "0.0 sec remaining" its last print should be "x.x sec total" or something
<zid> oh terminal magic, nice
<zid> that's a good idea
<klange> It's a pretty standard use of \r, some logic to avoid printing too often... it doesn't even scale the bar to fit the screen
<kingoffrance> re: resampling, https://github.com/shibatch/SSRC i used to use that because it claimed "high quality" but i dont know these things
<bslsk05> ​shibatch/SSRC - A high quality audio sampling rate converter (22 forks/112 stargazers/LGPL-2.1)
<moon-child> kingoffrance: afaik http://www.mega-nerd.com/SRC/ is the ideal one
<bslsk05> ​www.mega-nerd.com: Secret Rabbit Code (aka libsamplerate)
<moon-child> shibatch is the author of sleef, though, which is excellent
<kingoffrance> used as a user, i never looked at the code
<kingoffrance> i think it had some "HP" "high precision" define so you could build it twice
<kingoffrance> yep, see code, float v double, and different numbers
johnjay has joined #osdev
<klange> It takes longer to unpack my gcc package than to download it from the 'local mirror'...
bradd has quit [Ping timeout: 252 seconds]
<zid> takes me like an hour, but I unpack it in a special way
<zid> that makes it run itself
<klange> This is a binary package in a gzipped tarball. My gzip inflater isn't very fast.
<zid> yea I got it
<klange> For a bit there, I was trying to pipe my gunzip to my tar... but I guess I've got some severe performance issues with pipes because that was something like 4× slower.
<klange> So I switched back to decompressing first, then unpacking the result.
System123 has joined #osdev
Izem has joined #osdev
<zid> yea no copy pipes and stuff is a big optimization
DanDan has quit [Ping timeout: 245 seconds]
System123 has quit [Ping timeout: 260 seconds]
bradd has joined #osdev
johnjay has quit [Ping timeout: 245 seconds]
Izem has quit [Ping timeout: 252 seconds]
kingoffrance has quit [Ping timeout: 260 seconds]
isaacwoods has quit [Quit: WeeChat 3.2]
kingoffrance has joined #osdev
DanDan has joined #osdev
sts-q has quit [Ping timeout: 265 seconds]
johnjay has joined #osdev
sts-q has joined #osdev
pony has joined #osdev
Elbeeo has joined #osdev
Elbeeo is now known as asskoala
sm2n has quit [Ping timeout: 265 seconds]
sm2n has joined #osdev
johnjay has quit [Ping timeout: 265 seconds]
hl has quit [*.net *.split]
kciredor has quit [*.net *.split]
novasharper has quit [*.net *.split]
Raito_Bezarius has quit [*.net *.split]
grange_c has quit [*.net *.split]
ElementW has quit [*.net *.split]
geist2_ has quit [*.net *.split]
geist2 has joined #osdev
kciredor has joined #osdev
grange_c has joined #osdev
hl has joined #osdev
ElementW has joined #osdev
novasharper has joined #osdev
johnjay has joined #osdev
asskoala has quit [Ping timeout: 265 seconds]
chordtoll has quit [*.net *.split]
happy-dude has quit [*.net *.split]
mrkajetanp has quit [*.net *.split]
gmodena has quit [*.net *.split]
jeaye has quit [*.net *.split]
sahilister has quit [*.net *.split]
wille has quit [*.net *.split]
meisaka has quit [*.net *.split]
kanzure has quit [*.net *.split]
bleb has quit [*.net *.split]
vancz has quit [*.net *.split]
Santurysim has quit [*.net *.split]
sahibatko has quit [*.net *.split]
k4m1 has quit [*.net *.split]
kanzure_ has joined #osdev
bleb_ has joined #osdev
k4m1_ has joined #osdev
vancz has joined #osdev
meisaka has joined #osdev
bleb_ is now known as bleb
Santurysim has joined #osdev
mrkajetanp has joined #osdev
wille has joined #osdev
jeaye has joined #osdev
happy-dude has joined #osdev
srjek has quit [Ping timeout: 252 seconds]
System123 has joined #osdev
System123 has quit [Ping timeout: 252 seconds]
johnjay has quit [Ping timeout: 252 seconds]
pony is now known as lua
lua is now known as pony
sprock has joined #osdev
johnjay has joined #osdev
johnjay has quit [Ping timeout: 252 seconds]
kingoffrance has quit [Ping timeout: 252 seconds]
vai has joined #osdev
<vai> hi all
<vai> stopped smoking
<moon-child> great! Keep it up!
k4m1_ is now known as k4m1
<vai> moon-child: thank you sire
<vai> two days without smoke
<vai> moon-child: anyone completed TPM 2.0 support yet? on osdev? any articles?
<vai> heard it is a neat chip you can do things like virtualization etc.
<vai> Windows 11 "requires" it - but you can hack around it to run on TPM 1.0
<vai> Windows 11 doing blues
<vai> color theme completely blue and monochrome
<vai> hows sales guys over there?
johnjay has joined #osdev
<vai> so Windows 11 will be 64-bit only
<vai> Linux requires i486
<vai> SSE2 memcpy memset faster than i486
<bslsk05> ​community.intel.com: mmx memcpy - Intel Community
<vai> MMX FPU Standard Registers
<vai> what else do you need to copy on every task switch?
<vai> SSE2
<vai> endless list
<vai> TSS should do it all at once
kingoffrance has joined #osdev
* vai brewing more coffee
anon16_ has quit [Ping timeout: 260 seconds]
tacco has joined #osdev
<vai> Windows 10 supports new feature called virtualization of processes
<vai> so every process can have their own private suit virtual machine
<vai> it slows down the performance to 1/4 of the normal
<vai> it will be default on Windows 11?
<vai> tried it
<clever> vai: virtual memory already does exactly that, why add extra layers? what do you gain?
<vai> clever: extra memory protection.. thats how Microsoft tells us
<vai> Win32 is already executed in a container
<vai> you can get Win16 and MS-DOS support on Windows 10 by installing ntvdm drivers
<kingoffrance> maybe let you migrate processes across machines? devil is in the details
<vai> kingoffrance: it future the Windows will boot from a cloud
<vai> 5G makes it possible
<vai> so you can play games with a rented VPS machine with 256 cores and superior rendering 3D graphics display adapter
<vai> Windows will be just a plain stupid terminal
immibis has quit [Ping timeout: 265 seconds]
ZetItUp has quit []
anon16_ has joined #osdev
System123 has joined #osdev
<vai> guys -O4 is the way to go for kernel level thingies
<moon-child> only if you're using ibm xl
hanzlu has joined #osdev
johnjay has quit [Ping timeout: 268 seconds]
ZetItUp has joined #osdev
<vai> maybe I am too old school.. but I still fail to find use for FPU in the kernel mode
<vai> decimals I calculate by shifting 8 bits on and on
<vai> C64 nerd :)
Vercas has joined #osdev
<clever> vai: having the FPU on saves you from having to keep track of how many bits to shift in what direction for what operation
<clever> i have been guilty of using the fpu in irq handlers on my code, because my primary target allows it
<clever> then the code fails when i run it on arm
<clever> but i would love to see some proper fixed-point support in gcc
<vai> clever: so does ARM have any future at all?
<vai> should I focus on X86 / X64 or ARM
<clever> vai: for arm, the FPU is an optional addition, and you can configure things to raise an exception when the FPU gets used
<clever> some kernels implement lazy fpu context switching
<clever> so when they changed to another thread, they just disable the fpu, and leave the old threads state in there
<clever> if the new thread never touches the fpu, then you saved an expensive save/restore operation
<vai> say
<vai> how many kilobytes does Linux / Windows copy on each task switch event?
<clever> if the new thread does touch the fpu, it raises an exception, and you can context-switch on demand
<clever> not familiar with that low level of linux/windows
<clever> i only know how LK handles things
<vai> clever: I think only future for OSDEV and my kernel is the cloud
<vai> and thats where everyone is heading at
<vai> you can as well use NE1K / NE2K for ethernet internet access
<vai> it does not matter
<vai> it will all be virtualized
<bslsk05> ​github.com: lk-overlay/thread.c at master · librerpi/lk-overlay · GitHub
<vai> no need to write endless OEM drivers
<clever> this is a context switch routine that i wrote
<vai> clever: I want to see your mm.c
<vai> thats the hot potato
<clever> the C half of things, just calls some asm with the addresses to store the old state to, and to restore the new state from
<bslsk05> ​github.com: lk-overlay/thread_asm.S at master · librerpi/lk-overlay · GitHub
<bslsk05> ​medium.com: Best diet for developers. No, it’s not gonna be about pizza… | by Krzysztof Kempiński | kkempin’s dev blog | Medium
<clever> the asm half of things, will save ~21 registers, then restore the same 21 registers back out
<clever> each register is 4 bytes, so thats 84 bytes of state
<vai> clever: yeah well there are things like browsers which copy gigabytes of data and it still executes fast on todays Ryzen 9 and friends
<vai> basically your kernel can be literally slow
<vai> as long as it just works
<clever> most of that 84 bytes is stored onto the stack
<vai> clever: :)
<clever> and only the status register and stack pointer go into the thread state
<clever> on restore, it can just pop the other stuff off the stack
<vai> clever: so which stack does your exception handlers and interrupt handlers use?
RoaringWeevil has joined #osdev
<vai> current thread stack?
<clever> the stack of whatever it interrupted
<clever> yeah
<vai> so
<vai> stack overrun
<vai> kills the present thread
<clever> the hardware is capable of using a second stack, but i dont know how to access the original stack pointer
<clever> which complicates task switching
<vai> clever: its okay
<vai> probably wont notice if I just allocate big stack enough in the kernel level
<clever> i'm literally flying blind, i have zero official docs on the core :P
<vai> clever: I thought long time on why my kernel is crashing
<vai> the reason was I was using too small stack
<clever> there is also no MMU, so there wont be any exceptions if you overflow the stack
<vai> clever: I was used to Linux which uses dynamic stack, it grows up on demand
<vai> so
<vai> on own project I have mod the stacks a bit more than on Linux
<vai> dynamically allocated stacks have their exploits... security blows up
<vai> usually always
<vai> exploited by the crackers all the time
<vai> **usually on overload
<clever> my current code isnt having to interface with any attacker controlled data
<clever> the only source of data is the serial port and the SD card
<vai> clever: yeah
<vai> clever: if qemu ran on MS-DOS, I wouldnt be using Ubuntu
<vai> virtual terminals, QEMU, .. MS-DOS would suffice
RoaringWeevil has quit [Quit: WeeChat 3.2]
<bslsk05> ​github.com: lk/thread.c at a319a1f68d592529c03a1e95c369ffc0a2ed20cd · littlekernel/lk · GitHub
<clever> for a comparison, this is how LK is doing the x86 context switch
<vai> clever: I found out like everyone else - DOS applications are your friends.. esp. early stages of kernel OS development
<vai> easier to port
<vai> if they just idle on HLT
<clever> nothing i develop on has an x86 core
<clever> at least, when it comes to kernel dev
<vai> clever: wondering why Intel AMD guys didnt do TSS expansion accordingly when they added up registers
<vai> really insane
<vai> even i686 is an execution mode at low level kernel
<vai> and hardware
<vai> hidden on surfaces
<vai> clever: you are doing pretty well if you just skip supporting all the modes
pretty_dumm_guy has joined #osdev
<vai> two hours and shopping
System123 has quit [Ping timeout: 268 seconds]
GeDaMo has joined #osdev
RoaringWeevil has joined #osdev
RoaringWeevil has quit [Client Quit]
<hbag> ...can you connect your bitbucket account to vs code or just github?
<vai> hi
Arthuria has joined #osdev
<vai> anyone doing symbol tables with kernel development?
<vai> like it says where in function (names) it happened, like segmentation fault
<vai> my kernel symbol table is too big to be fit on a 1.44M disk though
<vai> and it is made in link time
<vai> so it is always too old
<vai> but if you it on external file system like sys: (lask 800 kilobytes of 1.44M disk), it is fine
<vai> dont like symbol tables with the binary kernel
<vai> link
<klange> I have no trouble including a symbol table in my kernel, and need to in order to link in modules at runtime.
RoaringWeevil has joined #osdev
dormito has quit [Quit: WeeChat 3.1]
<vai> klange: it helps a lot?
<vai> klange: can you embed your file system to Linux or Windows machine?
<vai> that surely would help a lot
<vai> else use archives
<klange> I don't follow. Filesystems are unrelated to symbol tables.
<vai> I am doing Linux integration of my kernel.
hanzlu has quit [Quit: Konversation terminated!]
<vai> Its much easier to test many of the features of the OS on Linux console, etc.
<vai> klange: do you have external drivers, or all embedded to the kernel?
<vai> microkernel approach is what I want to do
<vai> general OS development talk
<klange> They are modules built as object files and linked into the kernel at runtime by its own linker.
<vai> klange: I just thought symbol table would tell exactly where it happened - most useful feature
<vai> klange: how many init levels do you have?
<vai> security features require several
<vai> todo later for myself too
<klange> I don't know what you mean by "init level".
<vai> klange: levels of kernel layers
<klange> I still don't follow. I have a kernel. It is similar in architecture to Linux. Monolithic when it comes down to it, but built of loadable modules that share an address space and privilege level.
RoaringWeevil has quit [Quit: WeeChat 3.2]
<vai> klange: like e.g. user mode
<vai> seperated from kernel (root)
<vai> most developers don't know how to implement user mode
anon16_ has quit [Read error: Connection reset by peer]
<vai> but for functional kernel, it is probably not needed
johnjay has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
johnjay has quit [Ping timeout: 268 seconds]
hanzlu has joined #osdev
anon16_ has joined #osdev
johnjay has joined #osdev
Arthuria has joined #osdev
pretty_d1 has joined #osdev
geist has joined #osdev
pretty_dumm_guy has quit [Remote host closed the connection]
travisg has quit []
anon16_ has quit [Ping timeout: 265 seconds]
travisg has joined #osdev
hanzlu has quit [Quit: Konversation terminated!]
johnjay has quit [Ping timeout: 268 seconds]
johnjay has joined #osdev
<klange> cleaning up random things; redid the window decoration theme to use a sprite sheet, fixed up the text cutoffs on titlebars, did a quick rewrite of my image viewer... https://klange.dev/s/imgviewer_updates.png
pony has quit [Quit: WeeChat 2.8]
<Mutabah> Neat
<Mutabah> Quite a bit of blank area around the border it seems
<Mutabah> is that actual area, or just space in the sprite?
<klange> It's the shadow
<Mutabah> ah
<Mutabah> neato
roarwe has joined #osdev
roarwe has quit [Quit: WeeChat 3.2]
<rwb> feels like it would be nicer to have a bit more contrast between the background of the taskbar and the text... when you add in the highlighting and icons, it becomes pretty hard to read (i.e. the third taskbar entry in that image)
<rwb> most other things in the screenshot have a really nice contrast but the taskbar is kind of depressed looking
johnjay has quit [Ping timeout: 265 seconds]
johnjay has joined #osdev
dennis95 has joined #osdev
ZipCPU has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
<klange> rwb: I'm still playing around with some new designs for the panel. https://klange.dev/s/Screenshot%20from%202021-09-13%2020-59-16.png
<rwb> looks a bit nicer!
<rwb> the thing is, my monitors currently suck and i need all the contrast i can to avoid having to get glasses, so even light-gray on dark-blue is too little contrast for me
johnjay has quit [Ping timeout: 268 seconds]
johnjay has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
dormito has joined #osdev
anon16_ has joined #osdev
Arthuria has quit [Ping timeout: 268 seconds]
johnjay has quit [Ping timeout: 268 seconds]
m5zs7k has quit [Remote host closed the connection]
m5zs7k has joined #osdev
johnjay has joined #osdev
X-Scale has joined #osdev
ahalaney has joined #osdev
Izem has joined #osdev
System123 has joined #osdev
anon16_ has quit [Read error: Connection reset by peer]
anon16_ has joined #osdev
System123 has quit [Ping timeout: 265 seconds]
drewlander has joined #osdev
pretty_d1 has quit [Ping timeout: 265 seconds]
pretty_d1 has joined #osdev
<vai> klange has a very mature OS
johnjay has quit [Ping timeout: 268 seconds]
<vai> actually I have never seen so advanced OS
<vai> home made really?
<vai> :)
<j`ey> klange-made
<GeDaMo> Product of klangeheim :P
ZipCPU has joined #osdev
ravish0007 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
ravish0007 has joined #osdev
zoey has joined #osdev
isaacwoods has joined #osdev
fedorafan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnjay has joined #osdev
johnjay has quit [Ping timeout: 268 seconds]
srjek has joined #osdev
kanzure_ is now known as kanzure
johnjay has joined #osdev
sprock has quit [Ping timeout: 268 seconds]
fedorafan has joined #osdev
nvmd has joined #osdev
System123 has joined #osdev
System123 has quit [Ping timeout: 268 seconds]
asskoala has joined #osdev
<vai> klange: did you borrow lots from Linux kernel?
<vai> even borrowing takes a talent
<vai> indisputable
<Izem> I think that's harder then going from scratch
<Izem> s/then/than/
<jimbzy> Izem, I agree.
<Izem> does kms negate setting a resolution in grub?
<Izem> yeah tauros is incredible
<vai> I would not sell a house to fund my software project like Google founders did
<vai> work in a garage
<jimbzy> I'd sell your house, vai.
<junon> It's unfortunate that OS dev work has become almost entirely hobbyist material, unless you're at google working on the new SpywareOS.
<jimbzy> We are the HAM radio of the computing world :(
<Izem> weird too, cause there is totally a need for new os stuff
<junon> Yeah.
<Bitweasil> jimbzy, I would expect a non-trivial overlap between this channel membership and HAMs. :)
<jimbzy> I idle in #hamradio, Bitweasil :)
<junon> definitely an age correlation there too I bet. I'm too young to be into HAM, personally - where I'm from, it was a bit before my time as far as hobbies go.
<junon> I'd like to take it up when I have a bit more free time in life, though. Sounds really fun.
<jimbzy> I have never been licensed, but I've been a member of the ARRL for quite some time. I love their QST magazine.
<junon> how expensive of a hobby is it? ballpark estimate or whatever
<jimbzy> It depends, really. You could get on the air easily for less than $500
<Izem> seems pretty cheap if they were doing it ages ago :P
<jimbzy> Licensing is only like $35
theruran has quit []
theruran has joined #osdev
<junon> thanks jimbzy, good to know
<jimbzy> If you wanted to keep it simple you could do continuous wave (CW) morse code at reduced power.
<jimbzy> I think QRP is usually at 5w or less.
<jimbzy> If you go that route, use the Koch method to learn it. You'll be dit-dahing before you know it :)
nj0rd has quit [Quit: WeeChat 3.2]
nj0rd has joined #osdev
<jimbzy> I need to get my dang license this year. It's one of those things where if we don't use the spectrum allocated it's only a matter of time before the government decides to make it commercial and then we've lost it forever.
<Bitweasil> ^^
<Bitweasil> I need to get my general and extra, start using HF.
<jimbzy> You have your tech already?
kinder301 has joined #osdev
jakesyl has quit []
jakesyl has joined #osdev
<kinder301> So what are you even trying to say? That i am incorrect in the work i perform? Parellel device arbitration architectures have bus vulnerability, which has nothing to do with operating system sidechannels, why would anyone use system management bus interrupts or sidechannels to compromise the systems, when the bug is in the hurdware, it is not a bug there is no other way to do it with the materials we have in performant way in small enough form factor?
<kinder301> Formulating such attack vectors against service providers is of course very easy, cause the interconnect input and outut buses to scan in and out from honor wires rules, and those come from https://www.douglaskrantz.com/ElecElectricalFlow.html for instance among many other ones, when you read it you understand the vulnerability and how to get into most systems in the world, i also know the way to secure that pipeline in wire best pipeline mode, but
<kinder301> this would work by not gaining much of performance in comparison to the modes we have now, since the parallelism is hindered, the security archilles heel of security is the reason that they do not want to talk about this mode, but overconsumtion and idiotic arguments and brainwash and lies which result into this overconsumption is even a lot worse effect to the world.
<bslsk05> ​www.douglaskrantz.com: Which Way Does Electricity Flow?
dmj` has quit []
dmj` has joined #osdev
sprock has joined #osdev
<junon> jimbzy I'll add it to my list then :)
<kinder301> I have been leading the GPU research for many years, known that for many years, and if someone does never pay for my work which is real work not brumous pumping, than the same would happen with my every computer related businesses currently which made me to make the implementation how to secure my computers networks, so that my real work on computers will also be paid like for other lunatics allready who do not ever do any sane stuff even in contrast
<kinder301> to me. My life is all corrupted so madly that the effort to resist is allready in my genetics, it's bad to think about but to some degree i have to defend my life and actions in it, so that involves accounting with others moves against me and have a solid defense to resist like said
<jimbzy> I have to cut out for a bit, so have a great day and I will catch you all later :)
vai has quit [Ping timeout: 268 seconds]
vai has joined #osdev
<Bitweasil> jimbzy, yeah, got my tech, do a bit of local VHF work but outside the nets there's not much traffic on the few repeaters I can peg.
kinder301 has quit [Ping timeout: 252 seconds]
dude12312414 has joined #osdev
kinder301 has joined #osdev
dennis95 has quit [Quit: Leaving]
System123 has joined #osdev
<kinder301> There was nothing to do with illness of mine to take off all my privileges and human rights, first in favor of my sisters and their friends, then in favor of doctors who were hired to handle me, and every lunatic nuts humiliator in the world, i am simple victim of their illness still dealing with those mand people and trying to avoid the bloodiest conflicts, I am still operating with major losses but none of them actually gained any skills, cause skills do
<kinder301> not come with violating others or certain special stereotypes overall, trash talking and endless corruption and terror persistent is part of my life, i have to deal with it as resillient victim of that, nothing ever made sense including the gangster statuses given to me.
System123 has quit [Ping timeout: 268 seconds]
Izem has quit [Ping timeout: 268 seconds]
hanzlu has joined #osdev
* Bitweasil tries to figure out where the ftrace functions are screwing up the kernel.
<Bitweasil> And if it's a bug in the stuff I'm passing the kernel, or my instructions.
<Bitweasil> Both are possible. :(
johnjay has quit [Ping timeout: 265 seconds]
<kinder301> There is no bigger mental pain than to face, that my own family worked against me abusively and manipulatively for others to get an edge over me, and for me to be turned into cripple and those who ordered that my accessing or commanding those illies still do that, i mean what can i do, will i treat myself to overwighted vegetable in mental hospitals cause those outsiders were ill, no i aint do that.
kinder301 has quit [Quit: Leaving]
sprock has quit [Ping timeout: 265 seconds]
dude12312414 has quit [Ping timeout: 276 seconds]
Izem has joined #osdev
sprock has joined #osdev
<junon> So uh
<junon> elephant in the room, what's the deal with kinder?
<j`ey> junon: long term (years) user in here
<junon> huh okay
<GeDaMo> Can we swap them for an elephant? :|
<zid> might be less shit everywhere
* geist yawns
<geist> good morning folks
<Izem> morning
<Izem> I discovered a weird bug in sortix that happens with shell qouting, it's going to be interesting to track down
<geist> ooh fun
<zid> microsoft just never bothered, it's been busted for 20 years
<Izem> lmao
asskoala has quit [Ping timeout: 260 seconds]
<zid> I have a lot of files starting with [ and cmd just can't tab complete that character
<Izem> yeah there's also some signal stuff that has been postponed I think, doesn't deal with broken pipes properly
<Izem> zid: interesting naming convention :P
<zid> not really
<sortie> Izem: Yeah I was just looking into it. The problem is that you're not escaping your stuff in the best way. E.g. echo "\|" should've been echo "\\|"
<Izem> I thought \\ was \ ?
<sortie> Usually \x is implemented as just giving x when x is not a special thingey, which is what I did, and also what happens if you do echo \x in shell
<sortie> E.g. echo \| gives you just |
<Izem> I see
<Izem> hmm
<sortie> But turns out the rules are slightly different within double quotes, where \ only acts on $ ` " \ <newline>
<bslsk05> ​pubs.opengroup.org: Shell Command Language
pony has joined #osdev
<sortie> And for anything else, it's just a backslash. So that's why echo "\|" gives "\|" in the standard shells.
<sortie> Though ordinarily I would recommend you do escape the backslash properly, e.g. \\
<sortie> It's just cleaner and is what you'd do in C and such
<Izem> makes sense, I've not done much in C so it never came up
<sortie> In most places, you almost always want to escape a backslash if you actually want a backslash
<sortie> Shell single quotes is a notable exception where there is no escape character
<sortie> Izem, as for the signal stuff, the problem in those cases were that you didn't escape the pipe symbol, so you made a pipe. There's a few cases regarding background processes in shells and the appropriate stop signals and such that are unimplemented and you can easily trigger with a bad pipeline
<sortie> If you need a more reliable shell on Sortix, run dash. It doesn't have line editing though.
<Izem> oh ok
<Izem> thanks
<Izem> where's the code the login greeter?
<Izem> nvm found it
<Izem> thought it may have been third party
<Izem> learning about the framebuffer today I realise there's a lot of potential there, doesn't have to be a terminal emulator in Linux :P
<sortie> ^
asskoala has joined #osdev
<Izem> "On x86 systems, the kernel will be booted using the 32-bit boot protocol." -- Is this the same for x64?
<Izem> for grub
perihperal2 has joined #osdev
<zid> grub 0.97 only does 32bit, idk if there's a 64bit multiboot for grub2
<sortie> multiboot isn't 64-bit because that requires x64 paging to be turned on which is a very different beast
<zid> I make grub boot my bootloader, and that boots my kernel, kinda janky but it works perfectly
dutch has quit [Quit: WeeChat 3.2]
<perihperal2> Wire schematics as on motherboard i did not even check, no TCP specification extensively read, i just know how interconnect works in it's paradigm, tcp spec has been bookmarked some time ago somewhere only, once i get the hardware i will implement all from there, as i say i just know how RTL in from verilog synthesized or as in other languages works. I know how electrics work also, i have some money and i will push the needed bits to me, if zid kind
<perihperal2> a guys start to bother me in my locations they will be handled abusively, the conflict has reached the peak i will not forgive to any of your stalker, we will abuse you back bad, you are shithose to me i own your pals very fast with mine, and that all despite my injuries arranged amorally, currently i just rest , even my primary computer is somewhat physically damaged for some time, display broken, connector for charging leaks etc. I will soon buy
<perihperal2> new equipment, but morans like you i won't be dealing with, currently the sad part is that you do not understand what crap you are in the world, and always justify terror against random tourists and victims and kids of covid-19 terror , generally you are genetical monsters.
perihperal2 has quit [Quit: Leaving]
<geist> they *could* implement a 64bit extension to multiboot, but i guess there's just not a demand for it
<geist> since it's main purpose in life is to boot linux
<geist> hmmm, what does grub on 64bit UEFI do when it hands off? Guess it doesn't use multiboot in that case or does it actually drop down to 32bit first?
srjek has quit [Ping timeout: 268 seconds]
mctpyt has joined #osdev
dutch has joined #osdev
xenos1984 has quit [Remote host closed the connection]
<Bitweasil> If the CompareView counter on ARM is set to 0, will it fire? Per the manual, yes, but Linux is stuck in an interrupt loop, it's setting TimerView, which is fine, but leaves CompareView at 0, which... it doesn't seem to cause an IRQ loop on hardware.
xenos1984 has joined #osdev
paulbarker has quit []
paulbarker has joined #osdev
<sortie> Izem, would you like to credit you for reporting the bug using your real name that you used on gitlab or do you prefer your nick or no credit?
<Izem> I don't really care but using my gitlab name makes sense
<Izem> I still have to figure this out
<sortie> OK using that name
<Izem> thanks
mahmutov has joined #osdev
<Izem> yeah it's a different style to github which is just your user name I think, but now that I have a domain maybe I can host my own git server
System123 has joined #osdev
hanzlu has quit [Quit: Konversation terminated!]
<jimbzy> This is from my computer and information security class: 'Suppose your friend says to you, "The operating system really requires no protection because all of its code is on disk and can simply be reloaded if/when needed". How would you thoughtfully and thoroughly respond?'
<zid> "Til I save a virus onto the disk"
<jimbzy> Is "Are you stupid or something?" thoughtful and thorough? XD
<zid> or do they mean reload the disk
System123 has quit [Ping timeout: 268 seconds]
<jimbzy> That's the whole question.
<zid> doesn't do anything in the short term, you're still going to send out those 30k spam emails
<zid> plus you still need to detect it in the first place
<zid> and the image might be infected to begin with, blah blah
<Izem> so you are saying the operating system is reborn on a reboot
<Izem> data must be seperate?
<geist> Bitweasil: dunno, seems liek that sort of thing would be precisely covered in the arm manual
<geist> as in how does one disable it
<geist> oh i see you said you checked the manual
<geist> are you sure they're also not masking the irq or whatnot?
<geist> and just setting it to 0 for good measure?
<geist> jimbzy: is the disk write protected?
<Bitweasil> Hrm. I should double check and make sure it's the same timer.
<jimbzy> It doesn't say, geist. It's just a hypothetical question for discussion.
<zid> hope that isn't a software write protect :P
<Bitweasil> But they're setting the TVAL countdown register, which is fine, and setting the CVAL register to 0 - which means it always fires.
<jimbzy> No other details or criteria were given.
<geist> re: loading the OS from 'rom' it does bring up a point that i remember hearing a while back
<geist> one of the best security things you can do with your smartphone/etc is reboot it often
asskoala has quit [Ping timeout: 268 seconds]
<Bitweasil> Indeed.
<Bitweasil> Other than not having one. :)
<zid> It helps with persistance, obviously
<geist> idea being that most long standing exploits only infect the running state of the system and dont write back
<zid> but it's no excuse to ignore non persistant stuff
<geist> sure. also the sun is going to go supernova
<zid> pardon
<geist> well in a few billion years
<jimbzy> It's just an odd question because I don't have many friends who would ask such a thing.
<Bitweasil> I'm pretty sure the sun isn't going supernova. :)
<Bitweasil> Just... what, white dwarf?
<zid> Also yea, it isn't :P
<zid> red giant at best
<geist> YOU DONT KNOW!
<GeDaMo> Have to wait and see :P
* geist throws a tantrum and sweeps everything off the table
<zid> well, I'm sure he had a point
<geist> it was dumb and not really worth explaining
<geist> anyway, it did make me start being more liberal with the reboots
<Bitweasil> In any case, yes, rebooting phones regularly is a good workaround for the fact that we can't do secure software anymore. :(
<geist> though actually modern android phones seem to reboot much faster than they used to
<geist> so it's not a biggie
<jimbzy> I always turn my phone off when I'm not using it.
<Bitweasil> Memojis or whatever are more important than a secure message parsing change.
<Bitweasil> chain
<zid> do many phone virus things contain rootkits?
<zid> people go out of their way to buy rootable phones
<Bitweasil> Depends on what they want to do, but, yes, a lot of them are going to try for root.
<geist> my guess is the amount of work you need to do to actually modify and write back your hack is far greater than the value you get from it
<geist> so most dont bother
<geist> android i think at least mounts a sizable chunk of their fses in a RO mode so you'd at least need root to bypass all of that
<geist> and even that may be difficult to write to the root partition without flipping the mount over
<geist> or directly frobbing the fs
<geist> my guess is persistant hacks would tend to come in via some sot of data partition thing that re-infects the system on reboot
gwizon has joined #osdev
sprock has quit [Ping timeout: 260 seconds]
<Bitweasil> Yeah, shim into something that runs at root. Does Android do the ChromeOS style signed root filesystem merkle tree thing?
<Bitweasil> I've not run it recently enough, and it was a steaming trainwreck last time I ran it. :/
<Izem> does any os save programs to the reboot is really quick?
<junon> Doesn't every OS with "deep sleep" functionality do this?
<junon> IIRC windows and the like will pause and persist program state to the disk prior to going into a deep sleep and will restore everything once the machine is back online
<junon> err, back on*
<zid> linux also has both store to ram and store to disk
<zid> for suspend
<Izem> why only suspend?
<zid> what do you mean
<zid> when else would you want ram paged to disk, if you're not suspending the program
<Izem> you both mentioned suspend and deep sleep
<zid> (which is basically what happens with pagefiles)
<junon> It's the same thing, just depends on how much money you're dumping into your marketing team :D
<ZetItUp> https://pastebin.com/7E8SzDMQ why is my output so weirf with the first and second offset of bootcode? ;o
<bslsk05> ​pastebin.com: #include "fat.h"#include <string.h>FAT_BOOT_SECTOR fatBootSector;void - Pastebin.com
<Izem> I'm thinking of server reboots
<zid> There's actually a push in the opposite direction
<ZetItUp> does mkfs add some weird stuff?
<Izem> oh
<junon> Oh. Generally you don't want to persist program state for that.
<zid> make things able to reboot incredibly fast when they crash, because they will
<zid> so have them handle as little working memory / state as possible
<junon> pastebin is super broken today wow
<zid> and also the opposite opposite, have things essentially work from a persistant backend like sqlite for all their working set
<zid> so that they can crash and reboot with no data loss
<Izem> nice
<zid> but it requires you not to put corrupt crashing data into the working set ofc
<zid> ZetItUp: is this supposed to mean something to us?
<zid> I see a C program with some sketchy semantics, no info about the host environment etc
<Izem> is there such thing as a kernel restart?
<zid> not a clean one, you can kexec into a new kernel in linux
<junon> not a standard one* you mean
<zid> kexec /bin/new-kernel and it just starts booting as though you'd just told grub to do it
<ZetItUp> zid: my question was after the link
<zid> you said why is your output weird
<Izem> whaaa
<zid> my response was just now
<Izem> crazy
<zid> is this code supposed to mean anything to us?
<Izem> that's a nice feature
<junon> Izem if you write a kernel that can reset the CPU state back to a known good state (e.g. the state specified by Multiboot, for example) then in theory you can just jump to the start of your kernel again and it'll just restart.
<Izem> wow
<zid> It's just software, rezero .bss and jmp _start
<zid> cpu isn't magically keeping track
<junon> But tbh that doesn't really save you much time, POST and whatnot is quite quick
<Izem> still, I've never imagin such a thing
<zid> depends how much ram training you need to do, some servers take minutes to do that :p
<moon-child> similarly, in hosted c, you can call main
<junon> Izem: CPUs are pretty "dumb", so to speak. You tell them what to do and they do it. They don't have much magic with them since that kind of defeats their purpose.
<zid> Speaking of which, I have no idea if my machine will reboot cleanly or not next time, which is fun.
<zid> I changed my bootloader stuff and haven't rebooted since
<junon> moon-child: it's actually undefined behavior to call main from within the program
<junon> iirc
<Izem> so you can't save a functino pointer to main?
<moon-child> junon: only in c++
<Izem> how will the compiler detect this?
<junon> huh really
<moon-child> c++ also disallows union munging and has crippled designated initializers
<moon-child> all legit in c
<junon> TIL it's just C++
<junon> my adhd brain is working against me today
<junon> motivation seems to be in short supply the last few weeks. I think it was a side effect of the pandemic and just being sedentary for too long.
<Izem> zid: why did you choose a bootloader if you use grub?
<zid> I didn't
<Izem> so what does your loader do?
<zid> boots my kernel
<zid> sorta mandatory, given grub can't
<Izem> ok
<Izem> junon: break and gym :P
<junon> i'm looking at the table for grub2 platform compatibility and it states x86_64 can be booted via multiboot but only in 32-bit mode, does that mean you can write x86 instructions and then switch to x86_64 somehow? I'm confused by what they mean
<moon-child> right
<zid> which is what my bootloader does
GeDaMo has quit [Quit: Leaving.]
<sortie> junon: Yep
<junon> gotcha
<zid> but instead of catting the files together I just make grub load the kernel as a `module kernel.bin` so that I can keep it as a standard 64bit elf
<sortie> My 64-bit kernel is a multiboot binary that switches from 32-bit mode to 64-bit mode
<sortie> Yeah I put my 64-bit kernel in a 32-bit ELF format with the multiboot stub that switches into 64-bit mode. But I hear that as an extension, GRUB understands the 64-bit container too, though still boots multiboot in 32-bit mode. If that's the case, I should switch to that since it's cleaner.
<zid> I like the 64bit elf, lets me use `file kernel.bin` in gdb correctly and stuff
tacco has quit []
System123 has joined #osdev
<junon> zig, how does GRUB know where to jump? just using the standard ENTRY(start)?
nvmd has quit [Ping timeout: 268 seconds]
<zid> It multiboots the first elf as normal
<sortie> junon, yeah
<zid> but modules also get loaded, so my memory map is 0x10000: boot.bin, 0x11000: kernel.bin etc
<zid> all modules just get loaded sequentially after
<zid> and the crap in ebx tells you where the modules are and how big they are
<junon> ooOOOOoooOooOOO
<junon> big brain.
<bslsk05> ​github.com: boros/main.c at master · zid/boros · GitHub
nvmd has joined #osdev
<zid> kernel_start = mb->mods_addr->mod_start; init_mem(); map_bootloader(); for the 1:1 map for when I swap the page tables, then I walk the program headers in kernel.bin and map them
<zid> then go_long() swaps us to long mode and jmp's to kernel.bin's _start
<zid> It makes a crappy linked list of all the memory in the e820 and passes that along too
<zid> having removed the kernel pages
<junon> lol I have `oro_u32_t _unused_modinfo[6];` in there for the mod information, I guess I thought I didn't need any of it.
<junon> That will definitely change
<junon> thanks for the tip, that's very interesting.
<zid> works for me at least
<zid> I prototyped a few methods and this one sucked the least from my perspective, I'd still rather grub just booted it properly though
* moon-child whispers: eee efff iii
<Izem> moon-child: how is it working with tianocore?
<Izem> or whatever it's called now
<zid> why would I want EFI when I have 'janky grub solution'!
SanchayanMaity has quit []
<j`ey> Izem: edk2
SanchayanMaity has joined #osdev
<Izem> ah
gog has quit [Ping timeout: 265 seconds]
<Izem> I'm so interested in the boot process that in fact, it's probably better to build my own hardware :P
<Izem> that would make the osdev easier, but that's just more work overall
<moon-child> 'make the osdev easier' no, not appreciably
<j`ey> ^
<Izem> well that's dissapointing
<j`ey> Izem: why do you think it would make osdev easier?
<Izem> current stuff is too complicated
<junon> The boot process is like 1% of osdev though
<j`ey> and making your own CPU is easier??
<Izem> well, maybe not :P
<Izem> I guess that
<Izem> s just cause I want to make one too
System12_ has joined #osdev
sprock has joined #osdev
<Izem> well, later folks
Izem has quit [Quit: Going offline, see ya! (www.adiirc.com)]
System123 has quit [Ping timeout: 268 seconds]
dude12312414 has joined #osdev
averetzi has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<junon> Mrh if I wanted an overview of all of the pieces of the initialization puzzle for x86, where would I look? I'm tired of reading an article on how to do X and it says "but first you need TSS set up" and trying to maintain this large dependency graph of initialization steps and whatnot. Also it just feels like once I get the hang of all of the moving pieces of x86 there's just a completely separate
<junon> part of the chip I have to configure just to get something working. Is there a singular "list" or overview on osdev that I can get bird's eye view of all of it without reading the entire x86 spec?
<Bitweasil> the x86 spec...
<Bitweasil> :/
<Bitweasil> Intel SGX Explained is a decent overview of x86, though.
<junon> I have the PDF for the spec but it's mostly going over all of the instructions and extracting the architectural bits from it is a PITA
<Bitweasil> Which SDM volume?
dormito has quit [Quit: WeeChat 3.1]
<junon> let me find the link again
<Bitweasil> SDM1 is the "user interface" side of x86.
<Bitweasil> You want SDM3 for system programming.
<Bitweasil> https://eprint.iacr.org/2016/086.pdf is a good resource, though.
<Bitweasil> It's nominally about SGX, but it goes deep into x86 first.
<Bitweasil> Also, for those curious, if you set CNTP_CVAL to 0, and enable the timer, it won't fire until you set it to some non-zero value first...
<Bitweasil> Explaining my issues.
<Bitweasil> I cannot find this described in the manual.
<junon> thanks Bitweasil, putting that on my reader for later.
<Bitweasil> Also, if you're not explicitly planning to do a 32-bit OS, start with 64-bit on x86.
asskoala has joined #osdev
<Bitweasil> You may need to use some shims to get up there, but 64-bit is a lot cleaner than 32-bit.
<Bitweasil> It's still ugly, don't get me wrong, but it's less ugly
<junon> Ohhh you're referring to the volumes aren't you
<junon> of the SDM. I was just looking at the "combined pdf" version, which was probably a mistake
<bslsk05> ​software.intel.com: Intel® 64 and IA-32 Architectures Software Developer's Manual...
<junon> YES this is what I needed, thank you again Bitweasil. This is exactly what I was looking for, idk why I thought I needed the entire manual all at once lol
<Bitweasil> Oh. Yeah.
<Bitweasil> The combined PDF is fine, but you want volume 3.
<junon> :D
<Bitweasil> 1 is "instructions to use for writing code," 2 is instruction behaviors in great detail, 3 is system level stuff, 4 is MSRs, and all of those, especially 3 and 4, are overridden by whatever the chipset documentation and such says.
<Bitweasil> For osdev you can usually ignore 1, 2 is fine for a reference of "... what on earth does this instruction do?" when things don't work, and 3 is your bread and butter.
<junon> Gotcha, makes sense :) Trying to piece all of this together on osdev (which is a great wiki, just not what I want to rely on) and then getting frustrated with not understanding how the SDM is structured, was getting very old lol
<Bitweasil> It's pretty out of date.
<Bitweasil> :/
<Bitweasil> There's this channel, and then there are the people who do this stuff professionally, of which there's a good overlap.
<Bitweasil> And then I literally have no idea where else to find stuff. The osdev forums seem OK but I don't lurk there, IRC is way better.
<Bitweasil> And runs on my gutless wonders a lot better.
<junon> Yeah true. I would love to contribute back to the wiki as I've looked at it for over 10 years now. That's a ways down the line though.
<junon> Just the small spurts of osdev stuff I've done over the years has helped me become a better programmer in my day job anyway so I feel like I owe it back a bit.
<junon> Probably first thing I'll write about is how to use clang to cross-compile, as there's a stub page for iirc and someone mentioned I should write about it on the wiki a while back.
<junon> for it*
sprock has quit [Ping timeout: 268 seconds]
wgrant has quit [Ping timeout: 265 seconds]
wgrant has joined #osdev
<jimbzy> Wait... I thought this was discord?
<Bitweasil> Hm?
Burgundy has joined #osdev
<Bitweasil> No idea if it's bridged, I'm on Libra IRC.
<Bitweasil> libera.chat
<Bitweasil> I hate Discord, yet another heavy, fat, bloated Electron client, and you get centralized company ownership in the process who has a tendency to remove people they don't like.
srjek has joined #osdev
<jimbzy> I am being a weenie, Bitweasil :]
<klange> vai: there is nothing borrowed from anywhere, Linux least of all
sprock has joined #osdev
gwizon has quit [Ping timeout: 265 seconds]
System123 has joined #osdev
dormito has joined #osdev
System12_ has quit [Ping timeout: 268 seconds]
System123 has quit [Ping timeout: 268 seconds]
Burgundy has quit [Ping timeout: 268 seconds]
zoey has quit [Quit: Leaving]
<ZetItUp> feels good when you complete something you've struggled with :D
<clever> ZetItUp: yep
<klange> what is this "completing something" you speak of
<clever> i forked rpi-open-firmware back on november 2019
<clever> and now i finnaly have it booting with a framebuffer in linux
<clever> thats nearly 2 years of on&off work
<ZetItUp> i have been worrying about that i would fail to read a fat disk, been going back and forth etc, putting it on ice and so on
<ZetItUp> i finally started and showed myself that i actually could do it without copying someone elses code :P
<clever> the fat32 driver in LK is currently broken, and i havent bothered copying the one from rpi-open-firmware
<clever> instead, i took the ext2 driver in LK, and expanded it to support ext4
System123 has joined #osdev
<kazinsal> the name of rpi-open-firmware makes me think it should be a forth interpreter
sm2n_ has joined #osdev
sm2n has quit [Ping timeout: 260 seconds]
ahalaney has quit [Remote host closed the connection]
System123 has quit [Ping timeout: 260 seconds]
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #osdev
sm2n_ has quit [Remote host closed the connection]
sm2n_ has joined #osdev
sm2n_ has quit [Remote host closed the connection]
gog has joined #osdev
aejsmith has quit [Quit: leaving]
aejsmith has joined #osdev
devcpu has quit [Quit: leaving]
<geist> clever: what's broken? i should fix
<clever> geist: its not clear, it just fails to even mount
<geist> if you find something report it
<geist> ah
<clever> i think i had mentioned it months ago
<clever> the chainload pr is open, and once merged, the ext4 can be rebased and made thinner
devcpu has joined #osdev
<geist> cool, yeah just sitting down to do that right now
<clever> i have linux running on the pi2 now with all of those changes, and the only real problem is local to my overlay, the usb phy configuration
<clever> once i fix that, it will have working usb-host and framebuffer
<clever> then its just userland stuff, and improving cfg
<clever> oh, i had an idea for a testcase
<clever> what do you think, about a bootloader for qemu
<clever> so you compile an LK kernel, run it in qemu, with an ext4 fs
<clever> it then reads a linux kernel and dtb from ext4, and executes it
<clever> and it should be functionally identical to just running linux directly with qemu
<clever> and since its all VM, its easy to iterate and compare the 2
<clever> geist: ah right, and i have a potential problem, when i chainload linux, it only gets ran on 1 core, how do i force LK to run some asm on the other 3 cores, so i can prepare the for handover?
<clever> welcome to lk/MP
<clever> releasing 3 secondary cpus
<clever> its running in full SMP mode, so i need to get the scheduler to co-operate, and run my function on each core
pretty_d1 has quit [Quit: WeeChat 3.2.1]
<geist> can make a thread that sets the affinity to each of them
<clever> guess that works
<geist> or you can do a mp sync ipi to each of them
<geist> runs at interrupt context
<clever> threads seem simplest
<clever> hmmm, but an extra complication, is that all 4 cores have to exit mmu
<clever> linux is going to overwrite part of LK, so i need a tiny PIC stub, that i can put out of harms way, and idle in
<geist> that is hiiiighly odd. is this because of the raspbery pi specific 'must spin the cpu and be released' thing?
<geist> yeah guess it is. sounds like you need to reimplement that
<clever> the arm core itself, will start all 4 cores at the reset vector
<clever> so LK has to claim them, and park them somewhere until linux asks for them
<clever> currently, i'm letting LK claim them in full SMP mode
<clever> and i can re-park them with pinned threads
<geist> yeah kinda. that'd be a pretty bad abuse of the system, but it might be made to work
<clever> what happens to the other 3 cores, when you arch_chain_load() in an SMP LK?
<geist> usually you dont do that
<geist> or you shut the cores down first
<geist> but 99% of the time when chain loading folks build LK without SMP to avoid the problem
<geist> since it usually doesn't matter if your bootloader runs in SMP
<geist> i'd say probably all known LK based bootloaders run in UP mode
<geist> so probabl for your case i'd just avoid SMP, and manually boot and park the secondary cores
<clever> so i could build LK in UP mode, and write some custom asm in platform_reset to catch the other 3 cores
<geist> in some platform specific code, since yoru platform needs some custom way to start them anyway
<clever> so they park very early
<geist> right
XgF has quit [Ping timeout: 252 seconds]
<geist> *otherwise* you'd generally want to park the secondary cores before handing off
XgF has joined #osdev
<geist> which is what we do, for example, in zircon when doing a kernel -> kernel boot handoff
<geist> but i dont think i ever added code in LK to shut a core down. it's complicated and a PITA
<clever> so i have 2 routes, i can either modify arch_chain_load() to take an array of entry-points, and run it on every core at once, as it shuts down the mmu
<clever> or i can modify platform_reset to eat 3 cores before LK can ever notice them
<geist> the latter
<geist> the fact taht you have a dumb soc that is nonstandard should be a pltform specific problem
<geist> also can't take your CL as is, see comment
<clever> basically, i'm writing the code you would expect to find in an arm boot rom
heat has joined #osdev
<geist> sure, and arm boot roms aren't a preemptive, reentrant, SMP capable kernel
<geist> which gives them a bit more flexibility about tossing cpus around
<heat> h e l l o
<geist> hey heat, long time no see
<heat> it is me, warmth
<clever> geist: another problem i'll need to deal with, is configuring things like the fpu, on the other cores, because LK already did half of that for me on the main core
<heat> whats up
<geist> clever: yes, you outlaid what you needed to do
<clever> but i have that code already, in the rpi-open-firmware codebase
<geist> heat: not much, clever is once again hacking on raspberry pi
<geist> so generally speaking a big flood of rpi stuff
<clever> heat: i now have nixos booting on a pi2, with the framebuffer working, and its almost booting directly from whats on github, just some uncommited bug fixes
<geist> what is nixos?
<geist> oh, some linux distro
<clever> yep
<geist> for a second i thought we had some real osdev
<clever> source based like gentoo, but with a better build system, so build artifacts can be shared without complications
xenos1984 has quit [Ping timeout: 268 seconds]
<heat> i found out my ext4 driver is already getting used by nvidia
<heat> which is super cool
<geist> oh rad!
<clever> nice
<geist> how did that get pulled into their stuff?
<heat> edk2
pony has quit [Quit: WeeChat 2.8]
<heat> (uefi)
<geist> ah makes sense
<heat> and I did review/push some patches for the first time which is also interesting
<heat> more so than working alone I'd say, at least I've got nothing interesting going on in my OS
scoobydoo_ has joined #osdev
scoobydoo_ has quit [Excess Flood]
<geist> yeah, which commit system was it?
scoobydoo_ has joined #osdev
<heat> good old fashioned mailing list :P
<heat> but I think the project is migrating towards github pull requests
scoobydoo has quit [Ping timeout: 245 seconds]
scoobydoo_ is now known as scoobydoo