<geist>
oh interesting, i have heard cp437 for years but never put 2 and 2 together that it's the graphical character set
<heat>
i prefer that light blue to your dark windows 98 blue
<zid`>
Yea it's the vga bios rom's character ordering basically
<zid`>
so anything on a PC text console will be in that encoding
<geist>
interesting that it didn't get a lower number
<geist>
but guess it was either defined after the fact, or there's a ordering to the numbers, or the numbers had been assigned a lot earier
* geist
reads about it
<zid`>
yea I just googled it myself :
<zid`>
iso-8859-1 is '4' apparently, heh
<zid`>
in iananl, not ccsid
Matt|home has joined #osdev
<geist>
doesn't really say where the number came from, but it's interesting that it was basically copied from existing Wang word processors
<zid`>
okay so it's decodeable, but not quite sure what the scheme is
<kof673>
my dad used some wang stuff, but i do not know the details :/
<zid`>
I think you do some magic with looking at all the available glyphs, and the language it's supposed to encode etc, and it spits out a number
<Matt|home>
o\
heat has quit [Ping timeout: 256 seconds]
rustyy has quit [Quit: leaving]
srjek has quit [Ping timeout: 264 seconds]
<kof673>
well that explains that > One of the distinguishing features of the Wang PC was the system software. Similar to the Wang VS minicomputer, the command line was not evident. Everything could be run from menus, including formatting a disk.
pg12 has quit [Remote host closed the connection]
pg12 has joined #osdev
ThinkT510 has quit [Quit: WeeChat 4.2.2]
ThinkT510 has joined #osdev
<GreaseMonkey>
welp, discovering the hard way that having a target platform of "every IBM PC compatible" means you have to deal with two bugs that complicate things horribly
<GreaseMonkey>
1. when the 8088 gets an interrupt during e.g. a REP STOSW, it returns to *after* the op, so one has to check if CX is clear and maybe have to do it again... and the ones which check the zero flag require further checks
<GreaseMonkey>
2. POPF is an absolute no-go on an 80286 as it can let interrupts through even when interrupts are disabled and will be disabled as a result
<GreaseMonkey>
so one has to set up an IRET contraption instead
teardown has quit [Ping timeout: 260 seconds]
gildasio has quit [Ping timeout: 260 seconds]
gildasio has joined #osdev
teardown has joined #osdev
gbowne1 has quit [Read error: Connection reset by peer]
Gooberpatrol66 has joined #osdev
teardown has quit [Remote host closed the connection]
teardown_ has joined #osdev
<GreaseMonkey>
...after all that, i now have protected mode mostly working - it behaves in QEMU, and the real mode version generally works fine, but i'm getting repeated panics on 86Box for a more modern target machine (the 5150 works fine)
<geist>
well, grats for the parts that work!
kfv has joined #osdev
<kazinsal>
geist: get any good views of the aurora from your neck of the woods?
<geist>
it was *phenomenal*
<kazinsal>
nice
<geist>
i've never seen anything like it. you see it at all?
<kazinsal>
I got a bit of a view but nothing super fancy. too much light pollution around here
<geist>
ah yeah i went out to a park on the island (with half the population of the island) and it was great
<kazinsal>
phone got a better shot with a two-second exposure but the mark 1 human eyeball wasn't quite up to snuff for that
<geist>
yeah. there was a point about 22:45 or so where it covered like 2/3 of the sky
<geist>
though yeah the phone cameras do a great job too
<kazinsal>
yeah, that's about when I got the best view of it
<geist>
what they can't capture was the fact that it covered so much of the sky
<geist>
since you can only capture a little slice if it with the phone
<kazinsal>
probably would have gotten a better one if the dang fried chicken shop across the street had shut off their lights earlier after closing, grr
<kazinsal>
or if the power had conveniently gone out in the neighbourhood for, oh about 15 minutes or so
<geist>
yeah you really needed to let your eyes adjust
<geist>
i think it's still basically going on now, just settled down
<geist>
but if you scrub back to 22:30 or so it gets pretty nice
<geist>
though still just a slice
<geist>
22:50 or so really
<geist>
so downside of having fried chicken shop across the street: light pollution. upside of having fried chicken shop across the street: fried chicken
<kazinsal>
haha yep
<kazinsal>
and one of its neighbours is a pho/bahn mi place that's open 24/7
<kazinsal>
4am pho? you betcha
<geist>
oh dang, i miss having readily available pho
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kazinsal>
yeah, it showed up around the same as this slightly upscale-ish all-day brunch restaurant maybe six months ago and for weeks after opening it was jam packed all day long with delivery drivers in and out constantly, and the other restaurant was maybe a quarter full at the dinner rush
<kazinsal>
apparently there's never been a good pho place around here
GeDaMo has joined #osdev
zetef has joined #osdev
spareproject has joined #osdev
rustyy has joined #osdev
<geist>
yeah i dont think there's one here on the island
<geist>
lots in seattle thoguh
<mjg>
best distance for everyday trips is about 15 mins one way
<geist>
agreed
<mjg>
by fuckin' foot mind you
<mjg>
(or is it "on foot"?)
<geist>
i also argue that's about the best distance to commute to work is about 15 minutes. enough time to context switch from home to work
<geist>
on foot
<mjg>
work commute is part of everyday trippin'
<mjg>
bonus points if the spots one has to visit are in different directions
<geist>
yah
<mjg>
groceries one way, work the other, a park for jogging yet another etc.
<geist>
and/or if the route is a loop of some sort
<geist>
so the to/from route isn't the same
<mjg>
haha, man
<geist>
there was a period there where i lived about a mile by foot from work. about 20 minute walk. was pretty good
<mjg>
for a time i had to go to work with sun blazing my eyes
<mjg>
... and come back with the sun blazing my eyes
<mjg>
2/10 would not recommend
<mjg>
i had about 15 mins most of my life, A+
<kazinsal>
yeah my office is about a 30 minute drive, but thankfully I only "have" to go in one day a week
<mjg>
one day i decided to take a car instead of a walk, for no reason
<kazinsal>
though it's been a few weeks so I bet my desk has been desecrated by those godforsaken co-op students
<mjg>
between travel, parking, and walking to the office from where i had to park it was over 15 mins
<mjg>
:
<geist>
yah now i'm on the island it's a solid 1.5 to 2h commute either way
<mjg>
oooff
<mjg>
that's a no-go
<kazinsal>
one of those "you better be paying my ferry fares and buying me dinner for this" commutes
<geist>
well,m i moved in pandemic, knew this would be a problem some day if civilization didn't come to an end, and so it goes.
<mjg>
is that due to traffic or just distance?
<geist>
funny. by the crow flies it's about 7 miles to work
<geist>
but it involves at least a few forms of transit, including a ferry
<mjg>
pass
<mjg>
get a chopper
<mjg>
i mean a helicopter
<mjg>
;)
<kazinsal>
rob pike doesn't need any more dev funding for go, you can get a private helicopter for meetings :P
<geist>
then i can get to the choppa every day
<GeDaMo>
Hovercraft! :P
<geist>
i've heard some guy kayaks across the Sound every day
<geist>
but that sounds like a ridiculously dangerous idea
<kazinsal>
ooh, yeah. get a hovercraft, and a bucket of eels so you can roll up to work as a monty python bit
<mjg>
how often do you need to come in?
<geist>
technically 3 days a week
<geist>
you can fill in the details yourself
<mjg>
mon
<mjg>
hard pass
kfv has joined #osdev
<mjg>
full remote work is the shit
<kazinsal>
yeahhhh it's been a bit since I've been in. should probably go in next week at least to just ensure my desk is still mine and those youngins haven't turned my office into a laptop flashing station again
<kazinsal>
blow the dust off my conspicuous pile of "THIS DESK IS NOT A HOT DESK" books
<mjg>
the only thing i'm missing is shooting the shit with coworkers in person, but pros of full remote outweigh it
<geist>
wish i could fully remote but there are Reasons i cannot
<mjg>
do you plan to leave G anytime soon?
<geist>
honeslty i do like going into the office on occasion, if it weren't for the 2 hours
<mjg>
i'm guessing hard to leave that gig
<geist>
not particularly, but i also am not going to discuss that here
<kazinsal>
I try to coincide my days in the office with days I know someone's going to bring in a couple dozen krispy kremes or whatnot
<mjg>
if one necessarily wants to do os work and not be on linux
<geist>
yay krispy creme
<mjg>
i guess apple is the only viable option?
<geist>
oh reminds me there's a fantastic donut place in ballard. what was it
<mjg>
or some small real-time os firm
<kazinsal>
the only krispy kreme in vancouver is about mile from my office
<mjg>
well there is ms as well ofc, but i'm kind of mentally crossing that off
<geist>
oh wow the aurora is i think in good plae again
<kazinsal>
ooh. time to take this beer out onto the balcony and see what I see
<geist>
basedon the seattle stream
<geist>
yeah taking wine out to back yard
<kazinsal>
the aurora has made me realize how little I use my balcony
<kazinsal>
as it still has last years wildfire ash caked on everything
<kazinsal>
I'd take some mild filesystem recovery right now in exchange for 30 minutes of power outage
<geist>
to be fair... a part of it is the phones are better at capturing it than our eyes are
<kazinsal>
just to see more with my own eyes
<geist>
yeah
<kazinsal>
<mantra>i will not peg a rock at one of those cutouts i will not peg a rock at one of those cutouts i will not peg a rock at one of those cutouts i will not peg a rock at one of those cutouts</mantra>
<GreaseMonkey>
...is it me or does QEMU not emulate selector limits
<geist>
that doesn't seem right
<geist>
it's bound to do it
<kazinsal>
it definitely should
* geist
smiles at the pun
<kazinsal>
I know for a fact openbsd/i386 uses them judiciously and so do old dos-based windowses, so it's not like selector limits are an esoteric thing
<GreaseMonkey>
it seems it doesn't, which might explain why 86Box hits an exception while QEMU happily corrupts memory
<geist>
what about with KVM?
<geist>
that's real hardware
<GreaseMonkey>
hmm, lemme see
<geist>
thoguh i guess in that case it's not really emulating an 8086 or what yuo might be targetting
<GreaseMonkey>
KVM catches it, i'll stick with that for now
<kazinsal>
yeah if you want to target a specific vintage system, go full 86box or go home
<geist>
you know, honestly, i didn't know about 86box until today
<geist>
i thought bochs was the gold standard, and then i guess dosbox
<GreaseMonkey>
dosbox is far from gold standard, trust me on that one
<geist>
based on pcem, guess that's another lineage i dunno about
<geist>
yah i get the impression dosbox is much more of a git'r'dun sort of emulator
<kazinsal>
pcem was great but the author was kinda stingy about receiving PRs
<GreaseMonkey>
dosbox-x is at least somewhat decent
<kazinsal>
86box forked pcem in the name of expanding capabilities accurately
<kazinsal>
so 86box can pretty much cycle-accurate everything up to a pentium ii
<kazinsal>
given a powerful enough CPU
<kazinsal>
and supports all sorts of weird and wacky ISA and PCI cards
<geist>
noice
<GreaseMonkey>
IIRC the cycle accuracy assumes your emulated RAM is really fast
heat has joined #osdev
<kazinsal>
yeah, there's a bit of a combo of fast enough CPU + fast enough RAM when you get past like, ppro
<GreaseMonkey>
but yeah, a couple of good examples of why mainline dosbox sucks: 1. the 16-colour palette is forced on EGA based on the output height being exactly 200 (the correct way is to check the monitor polarity)
<kazinsal>
the biggest thing holding it back from being a generally user-useful emulator right now is that it doesn't have a unified frontend like virtualbox
<kazinsal>
also I wish it supported slangp for its vulkan renderer because then I could use a really nice 4K CRT emulation shader instead of one from like ten years ago
<kazinsal>
I want to use the same one I use in retroarch, dammit
<GreaseMonkey>
and 2. the CGA 2bpp-chunky shifter bit, on many emulators inaccurately makes it treat the upper 2 bit planes as all 0 (dosbox-x gets this right... and so does qemu oddly enough - and ALL HARDWARE I TESTED also gets this right)... but dosbox is truly special in that it just makes it completely ignore the EGA write mask
<kazinsal>
I think the dosbox-pure fork fixes some of the mainline dosbox bugs
<kazinsal>
but it's also only available as a libretro core
<kazinsal>
though it exists specifically to be able to use zips as "ROMs" with folders as simulated hard disks so it's a bit special
<GreaseMonkey>
oh neat dosbox-pure is also part of the NE2000 club
<kazinsal>
works great for playing dos games from 1983 in 4K with a GPU CRT shader though
<kazinsal>
been watching through a daily stream of a dude in australia playing through every commercially released DOS game ever an hour per day
<GreaseMonkey>
y'know what emulator we need? one where you need to adjust the screen offset based on the video mode
<kazinsal>
using dosbox-pure
<geist-sdf>
DDDDDDOSSBOX
<kazinsal>
it's been almost a year and he's only midway through the Ls
<geist-sdf>
or i'm sure there's at least one additional x86 emulator inside mame right
zetef has quit [Read error: Connection reset by peer]
<kazinsal>
dosbox-pure, but it gives you virtual knobs to fiddle with the CRT adjustments
<geist-sdf>
does simh do x86?
<kazinsal>
maybe? there's so many different "current" versions of simh
<geist-sdf>
yah no kidding
<geist-sdf>
oh reminds me, did you see pidp10?
<geist-sdf>
want.
<kazinsal>
I did, it looks fantastic
zetef has joined #osdev
<kazinsal>
I should get a pidp-11
<GreaseMonkey>
oddly enough, 86Box does emulate the border *colour*... but doesn't emulate the active display panning (EGA PEL panning works though, but i had a rather big argument while trying to get it implemented correctly)
<geist-sdf>
honeslty of the existing pidps, the pidp8 is the most fun
<kazinsal>
I keep thinking "I can't afford all these fancy gizmos" but then I remember a) I got paid out a good bit of "fuck along now" money from my old job and b) I get paid public university union money now lol
<geist-sdf>
it's a simple enough machine that it just is fun to manipulate
<geist-sdf>
pdp11s get into proper minicomputer territory where you boot OSes that need to be properly shutdown and whatnot
<kazinsal>
I feel if I bought a pidp-11 I'd get even more sidetracked in my osdev stuff
<geist-sdf>
true, i mean you can just direclty drive simh if you want
<kazinsal>
I already forgot about my main project to fiddle occasionally with my gimmick project
<geist-sdf>
having the lights doesn't technically change anything
<kazinsal>
I'd probably get sidetracked from that if I had a blinkenlights pdp-11 simulator
<GreaseMonkey>
do they come with a magic/more magic switch?
<kazinsal>
instead of reimplementing unix for the pc/xt as a lark, I'd end up reimplementing unix for the pdp-11 as a lark
<geist>
sort of, in the sense that the pidp11 you can select the OS to boot with the front panel switches and a push on one of the knobs
<geist>
which i think didn't exist in the original pdp11
<geist>
its all implemented as a thing that resets the simultation and picks a differeent setup ini
<geist>
but that's how yu have like 64k systems ready to boot
<kazinsal>
yeah
<GeDaMo>
"It would be fun to include it in the PiDP-10, at the back. But how, it's non-trivial to make a circuit that senses something from a switch on a single wire? I've been looking for a simple, affordable circuit for a while now, and asked for help in the Group and elsewhere. Still looking." https://obsolescenceguaranteed.blogspot.com/2020/02/inevitaby-pidp-10.html
<bslsk05>
obsolescenceguaranteed.blogspot.com: Obsolescence Guaranteed: Inevitaby, the PiDP-10...
<kazinsal>
the original 11's front panel is basically just a machine code monitor
<geist>
oscar is a good guy. i met him once at once of the VCFs
<kazinsal>
but bootstrapping a pdp-11 is only a dozen words or so
<geist>
yah sadly my real PDP11 is a very late model where there's no front panel
<geist>
it's all been reduced to a set of ASICs (LSI-11)
<kazinsal>
since the processor boards of the disk controllers are almost BIOS-like in their command sets
<kazinsal>
so you just bang some code in to tell the disk to load sector 0 to $address and then jump
<geist>
OTOH it acts like a fully loaded PDP-11/70 as a result, with a proper 22 bit addressing bus, etc
<geist>
yep. MDSCP? something like that. a very simple controller for that
<geist>
actually kind ainteresting if you go back and read the specs of what DEC was doing at the controller level, it was pretty sophisticated. almost NVME like
<geist>
but then these were expensive boards with lots of processing power on them
<geist>
for my pdp11/53 i have a large SCSI board, which apparently implements the MDSCP? MDCP? (i forget) programming model
<geist>
so the OS/bios doesn't need to know that it's scsi at all
<kazinsal>
I think at the time the "it crashed" bootstrap process of a PDP-11 running unix was like, 1: toggle in a quick self-modifying code bootloader that reads a new loader in from paper tape; 2: hit continue to load in the actual loader from paper tape; 3: hit continue to run the new loader that loads the bootstrap from disk
<geist>
OTOH its a pretty large and expensive board
<kazinsal>
for like an 11/20 etc
<geist>
yah
<nikolar>
geist how big is that late model
<geist>
yah a real old PDP11 would be lovely to obtain, but.... they're also very power hungry, etc
<kazinsal>
reminds me, I need to order a couple rolls of tantalums for the PS/2
<geist>
nikolar: a full size like 4u rack really
<kazinsal>
should only be a couple hundred lines of code to get the dumb XT unix booting on it
<geist>
pretty deep
<kazinsal>
mostly for the 1.44 floppy stuff and the differences in the kbc
<geist>
but i dont have any plastics for the PDP11, so it's just a long ass metal 19" rack
<nikolar>
I saw some Soviet pdp11 clones on eBay
<kazinsal>
reminds me, I need to see if work's gonna throw out any 11U racks anytime soon. wouldn't mind putting one under my desk to properly mount stuff
<nikolar>
GeDaMo does pdp11 compatible mean that Unix works there lol
<kazinsal>
right now I've got an absolute mess with my home server, an old obsolete 3u cisco, and my vax splayed out with my switch balanced upon all three
<kazinsal>
all sitting sorta under my desk
<GeDaMo>
Wiki doesn't mention
<geist>
kazinsal: FWIW startech stells some pretty cheap ass racks
<geist>
i bought a giant like 5 foot startech rack that i put most of my sstyff in nowadays
<bslsk05>
ignusius/bkunix - Port of LSX Unix to Elektronika BK-0010 microcomputer. (0 forks/6 stargazers/GPL-2.0)
<geist>
nikolar: hmm, how much 'no mmu' does that mean?
<geist>
like, segmentation based (a la pdp11) or just have to copyin/copyout on every context switch?
<nikolar>
Not sure, someone just mentioned it under that post
<geist>
from readingh that readme, it probably had some wonky way of mapping things in
<nikolar>
Yeah no mmu probably refers to segmentation so who knows how it does things
<geist>
yeah various permutations of providing the top N physical bits of address
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<geist>
there's a handful of ways to do it. 8086 being particularly weird
<nikolar>
Heh yeah
<kazinsal>
yeah
<geist>
it's late
* geist
goes to bed
<kazinsal>
zzz
<nikolar>
Good night
<nortti>
https://gunkies.org/wiki/LSX talks of everything sharing a single address space, so I guess "none at al"
<bslsk05>
gunkies.org: LSX - Computer History Wiki
<GeDaMo>
Xenix originally ran on 8086 which also had none
<nortti>
8086 at least allows you to have the same virtual address correspond to different physical addresses
<GeDaMo>
You mean with segments?
netbsduser has joined #osdev
kfv has joined #osdev
<nortti>
aye
<GeDaMo>
64K should be enough for anyone :P
leg7 has joined #osdev
<nortti>
separate I+D gets you up to 128K!
<GeDaMo>
And stack!
<GeDaMo>
The original IBM PC only came with 16K RAM by default
<kazinsal>
I wish I had numbers on different sales configurations of them
<kazinsal>
I suspect that the 16K+cassette only config was very rare
<kazinsal>
even 32K+disk is difficult to run DOS 1.1 on
<kazinsal>
you only get about 18K for programs
<nortti>
you needed at least 32K to be able to use floppies at all right? since the ROM basic does not have floppy routines, and floppy boot loads just below 32K
<kazinsal>
lemme pop open the book of knowledge
* kazinsal
pauses Death Wish
<kazinsal>
looks like the original april 81 ROM BIOS has floppy stuff in it
<kazinsal>
but yeah it loads at a fixed 7c00
<kazinsal>
BOOT_LOCN is an EQU 7C00
<kazinsal>
running DOS 1.1 on a 32K+disk PC gives me just over 18K free
<kazinsal>
no way to accurately get a number but rough guesstimate is that BASICA + PSP is ~17000 bytes, and that gives me another 1569 bytes for BASIC program storage
<kazinsal>
so yeah, real tight
<kazinsal>
`basic` gives me 6730 bytes free on top of a 10880 + PSP byte COM so yeah
<kazinsal>
call it DOS using 13K of your memory
<GreaseMonkey>
a 16 KB PC would require a tape loader
<GeDaMo>
I don't think IBM sold complete machines, you had to order all the bits you wanted like RAM, keyboard, video card
<kazinsal>
they didn't sell kits that's for sure
<kazinsal>
but you ordered your particular configuration from the form
<GreaseMonkey>
i am intentionally targetting the 32 KB configuration as a bare minimum but i do intend to get a tape loader working once i work out what the hell i'm doing on that front
<GreaseMonkey>
(erm... using 86Box for testing)
<nortti>
what's the project?
<kazinsal>
I've been fiddling around targeting 128K since that's the minimum of an XT
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<GreaseMonkey>
current project is something that can be useful on an IBM PC compatible, not necessarily full-featured everywhere, but i'm using a crapton of dynamic linking to achieve this
<GreaseMonkey>
trying to get the PICs to behave right now
<kazinsal>
unix in 128K is totally doable
<GreaseMonkey>
(well, trying to get the masks working - the other stuff is working)
<ddevault>
god
<ddevault>
signals
<ddevault>
what a clusterfuck
<kazinsal>
signals: usable on single processor systems. nightmare everywhere else
<GreaseMonkey>
have you heard of our lord and saviour, Event Queues?
<nortti>
I have vague memories of reading how on windows signals are implemented by injecting a thread into the process, which is somehow cleaner than the traditional unix design
<mjg>
is that how it really happens?
<mjg>
i thought the base of windows programming is building stuff around an event loop
<mjg>
which then could also handle "signals", whatever it may happen to be
<GreaseMonkey>
yeah i'd've thought one'd've gone with the GetMessage()/TranslateMessage()/DispatchMessage() loop
<nortti>
for windows subsystem apps sure, but console subsystem is quite similar to unix or DOS where you block on I/O
<kazinsal>
win32 is just one layer on top of everything else
<kazinsal>
there's a reason you can feasibly implement a userspace emulation of whatever you like on top of NT
<kazinsal>
it was designed to do Windows, Unix, OS/2, and VMS if needed
<kazinsal>
VMS never got implemented because there was no market for it
<nortti>
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=msvc-170 "SIGINT is not supported for any Win32 application. When a CTRL+C interrupt occurs, Win32 operating systems generate a new thread to specifically handle that interrupt. This can cause a single-thread application, such as one in UNIX, to become multithreaded and cause unexpected behavior."
<bslsk05>
learn.microsoft.com: signal | Microsoft Learn
<ddevault>
injecting a thread into the process does sound somewhat cleaner
<ddevault>
but still, what a mess
<ddevault>
I'd sooner just have no preemptive means of interrupting another process
<kazinsal>
if and when I get back to doing my real actual osdev project that's how I plan on doing it
<nortti>
looks like SIGINT is the only signal that's actually used for async communication with another process, others are ways to handle exceptions
<nortti>
or included as stubs for standards compliance
<kazinsal>
parent thread that can interrupt other threads that waits until it gets a signal
<ddevault>
only thing you can do is forcibly terminate processes
xenos1984 has quit [Read error: Connection reset by peer]
<ddevault>
and maybe some conventional means of cooperative preemption
<kazinsal>
such that a ProcessStart spawns a thread that then spawns the actual main thread, while the base thread is a wait loop whose first action is ThreadPause(THREADS_ALL_CHILD_SIGNAL)
<kazinsal>
such that if needed child threads can opt out of being paused by THREADS_ALL_CHILD_SIGNAL
<nortti>
ddevault: coöperative preëmption as in, a way to post a flag that is polled by the process itself?
invisbaka has joined #osdev
<ddevault>
yeah
<invisbaka>
Hi there, i'm new to osdev, and I have a question: Is it better to start off with a protected mode kernel, and later port it to long mode, or is it better to develop in long mode from the start
<kazinsal>
I would personally recommend learning the particular requirements of long mode first and jumping in there. on paper protected mode is "easier" but you will hamstring yourself going for protected mode and then then porting to a proper native 64-bit platform
<kazinsal>
there's certain fundamentals you should know before going into a 64-bit environment on x86-64 like the binary math for sign-extension
<ddevault>
protected mode only exists as a brief stepping stone on the way to long mode, same as real mode, imho
<kazinsal>
a 32-bit protected mode environment probably have a more forgiving feel to it even though it's still a freestanding environment, but it's definitely more of an experimental area
<kazinsal>
can you write a whole user-facing environment in 32-bit protected mode? yep. is it extremely limited compared to a 64-bit enviroment? also yep.
<invisbaka>
makes sense,
<kazinsal>
like, consider that in a single machine cycle a 64-bit long mode environment can seamlessly move twice as much data in memory as a 32-bit protected mode environment
<kazinsal>
you can do so much more in much less time in 64-bit than you can in 32-bit
<kazinsal>
32-bit's main advantage is having less to remember in your head when you're building out the base framework
kfv has joined #osdev
xenos1984 has joined #osdev
<FreeFull>
If you just want to make something work, is targetting risc-v a good idea?
<kazinsal>
only if you have no thrill of booting your work on a physical machine
<FreeFull>
Well, you can get a risc-v dev board
<FreeFull>
I guess going with ARM would be cheaper though
<kazinsal>
or you can pop a USB into any one of fifty billion x86-64 machines
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FreeFull>
Yeah, as long as they have secure boot disabled
<kazinsal>
in my experience, a very small fraction of machines
<FreeFull>
I guess with UEFI starting you out in long mode, you don't have to worry about switching the CPU into it, at least
<kazinsal>
contrary to popular psychosis, secure boot is not required for windowses 10 nor 11
<kazinsal>
it's purely an enterprise dealio
<kazinsal>
often much a thing "required" by fleets of Dell machines or whatnot
<kazinsal>
hell, you can boot windows 11 off a protected MBR on a GPT disk without secure boot
<FreeFull>
So most manufacturers ship with it disabled by default?
<kazinsal>
yep
<kazinsal>
most often either disabled or enabled in "limp mode" where it just whines at the bootloader if it doesn't get a stored key
<ddevault>
got a naive form of signals working
<ddevault>
and now dash handles sigchld and works and so on
<ddevault>
ignoring any issues with this implementation and moving swiftly along
<kazinsal>
if secure boot isn't set to strict then UEFI will pass along a "don't do that :(" to the application
<kazinsal>
also CSM was supposed to be disabled out of the box years ago but it still isn't
<leg7>
how do modern oses deal with all the diffrent chipsets northbridge/southbridge and pch chips. Do you have to rewrite your driver for every chip?
<kazinsal>
they came up with standards for all the basic functionality of all the bits and bobs
<kazinsal>
so that each specific vendor and chipset variant at most has a few extra little I/Os to deal with when programming
srjek has joined #osdev
<leg7>
so if I write an IDE driver for some chipset It will also work for a different chipset?
<kazinsal>
yep, things like IDE and AHCI are standard
<FreeFull>
My current laptop actually came without CSM
<leg7>
ok cool
<kazinsal>
it's when you get into specific types of various chipset properties that you get into problems
<kazinsal>
like various subdivisions of intel northbridges
<kazinsal>
anything basic gets a pretty standard setup
<kazinsal>
eg. IDE and SATA is mostly universal
<kazinsal>
almost all gigabit intel ethernet chips can use the same code
<kazinsal>
that kind of thing
<nikolar>
Mine came with mbr and I'm using it :)
<kazinsal>
protective MBR on GPT is a fun one because you can pretty easily scan a GPT in 500-ish bytes
<kazinsal>
and load a second stage from there
<kazinsal>
they wanted it to be wholly done by UEFI but you can implement it in a handful of instructions no problem
<ddevault>
though note that a mounting feeling of dread when consulting the linux source code for a standard you want to implement and seeing "quirks" everywhere is a common osdev experience
invisbaka has quit [Quit: WeeChat 4.2.2]
kfv has joined #osdev
<leg7>
ddevault: are you drew devault?
<kof673>
freebsd literally called hardware options "quirks" :D
<FreeFull>
Yeah, when hardware does something weird, it's always the software that picks up the slack
CryptoDavid has joined #osdev
<ddevault>
leg7: yeah
navi has joined #osdev
kfv has quit [Remote host closed the connection]
Ram-Z has quit [Ping timeout: 240 seconds]
kfv has joined #osdev
<heat>
i want to note that the IDE controller (from the OS's perspective) is AFAIK definitely not a standard
<heat>
it's one of those IBM garbage chips that only has docs in the OG IBM PC docs, or around intel chipset docs
<heat>
e.g IIRC the whole "DMA can't cross 64KiB boundaries" was PIIX3 errata that just stuck
kfv has quit [Client Quit]
<heat>
... which is why if you read the comments/docs on linux's IDE driver, they directly reference specific chipsets
d5k has joined #osdev
<heat>
AHCI also has an incestuous relationship with chipsets but at least it's actually a standard
<heat>
but this is to say the definitive answer to "so if I write an IDE driver for some chipset It will also work for a different chipset?" is yes....ish
<kof673>
"quirks" :)
<heat>
not /just/ quirks but also stuff like "how do i configure DMA?" (although the usual way outside of linux, etc is to hope the BIOS did it for you)
<kof673>
yes, and it has been a whlie...don't you need a capable cable as well :D
<kof673>
*while
<kof673>
meaning, i believe some features were off by default for safety, but if user knew was supported, could enable them
<heat>
that, i don't know
Ram-Z has joined #osdev
<kof673>
ata(4) DMA limited to UDMA33, non-ATA66 cable or device freebsd, anyways :D
zetef has quit [Read error: Connection reset by peer]
kfv has joined #osdev
<leg7>
is the pic standardized at all?
<leg7>
or apic?
Ram-Z has quit [Ping timeout: 268 seconds]
kfv has quit [Read error: Connection reset by peer]
kfv has joined #osdev
gsekulski has joined #osdev
kfv has quit [Read error: Connection reset by peer]
kfv has joined #osdev
Ram-Z has joined #osdev
<heat>
leg7, the pic is not, the apic is (it's even architectural)
<heat>
basically when you see a piece of hardware that was in the IBM PC, it's largely unstandardized (apart from everyone cloning the same functionality from the IBM PC down to mid 90s intel down to 2024)
<zid`>
I'd say it's standard
<zid`>
PC is a standard, and PIC is part of it, and it's never not worked how it works
<heat>
there's no spec for the PIC, most bits in PIC registers have been completely useless (as in, ignored) since the mid 90s intel chipsets
<zid`>
most bits of most standards are ignored
<heat>
the PC is a best-effort solution to make MS-DOS work in 2024
<heat>
no? i've never seen an AHCI controller that ignores 90% of mandatory functionality
<heat>
meanwhile if you program the PIC according to the IBM PC docs it just won't work unless you configured it how everyone did for the last 40 years
<zid`>
So it will work
<zid`>
as long as you set it up how a PC uses it
<zid`>
because a PC is standard
<heat>
no, it's not
<heat>
the IBM PC had many different ways to configure the PIC
<heat>
it just turns out nobody did, so the PC compatibility hack just doesn't bother implementing the things MS-DOS doesn't use
<zid`>
and how many ways *did* ibm configure the pic?
<heat>
idk this is an OS thing isn't it?
<zid`>
Presumably, lots and lots and lots of ways, rather than using one, standard, configuration, right?
<zid`>
right?
<heat>
*maybe* a BIOS thing in the really early days, but as soon as you got into protected mode it was an OS thing, and there they could set it up as they wanted to
<zid`>
The standard just so happens to be "It'll be connected to this port, chained in this way, and responds to these commands"
<zid`>
not "Read the datashet for the 8259(?) and it does all that"
<ddevault>
it makes the result of the encapsulating expression the yieled value
<ddevault>
find the nearest { } and it terminates that block with the yielded value as the rvalue
<ddevault>
yielded*
<ddevault>
it's admittedly not a great keyword but ears open for suggested alternatives
<heat>
ah i see, it's always in a = match() or = switch() expression
<ddevault>
not always, but commonly yes
<ddevault>
you can also do let x = { yield 10; } if you're weird like that
<heat>
>assert(flag & mman::flag::ANON != 0); // TODO
<heat>
EINVAL!!
<heat>
anyway looks nice
<heat>
are you using a BKL or are you not dealing with concurrency yet?
<heat>
i don't see locks at least
<ddevault>
I use assertions for stuff that I ought to implement
<ddevault>
and INVAL et al for stuff I don't want to implement
<ddevault>
there's no SMP so few places need locks
<ddevault>
the only preemption is in predictable locations
<ddevault>
will probably do BKL at least to start if I add SMP
<heat>
you still need them in case you block
<ddevault>
depends.
<ddevault>
you're right
<ddevault>
but it's dealt with in other ways
<ddevault>
like if all of the AHCI command slots are occupied and you submit a read it returns EBUSY
<ddevault>
but it cannot race
<ddevault>
without preemption
<heat>
hmm i guess the need is still a bit limited yeah
arminweigl_ has joined #osdev
<ddevault>
if I tried to lock that I'd just end up with a deadlock
<ddevault>
EBUSY is the right answer here
<ddevault>
locks only needed if you have kernel preemption or SMP
arminweigl has quit [Ping timeout: 256 seconds]
<ddevault>
take lock => switch out of the kernel => bad things happen
arminweigl_ is now known as arminweigl
<heat>
it's nice how you can implement unix in a very minimal, elegant way
<ddevault>
though I did drop a spinlock implementation into sys/sched/ a while ago for no reason, nothing uses it
<heat>
very early UNIX-like
<ddevault>
some of it is elegant
<ddevault>
but signals are disgusting
<heat>
:))
<ddevault>
and it took five or six revisions of the scheduler to get to something good enough
<heat>
i have my own early UNIX clone but never got to actually finishing it up with some useful functionality. mostly because i can't be arsed to do things i've written before, such as writing a block driver
<ddevault>
AHCI is not terribly bad
<ddevault>
but beware that you have to deal with staggered spin-up to support real-world devices
<heat>
i spin up the device on staggered spin-up, but i don't do anything else. that might be a bit borked
<ddevault>
of all the specs I've read AHCI is among the less annoying, though you have to pair it with some extremely annoying specs like ATA for a complete understanding
<heat>
the nicest block driver to write is NVME IMO
<ddevault>
yeah I need to write an NVME driver
<ddevault>
of my two testbeds, one uses AHCI and the other uses NVME
<heat>
but at least with the arch seabios build, it doesn't seem to want to boot from my NVMe, for reasons unknown (upstream says it works)
<bslsk05>
arstechnica.com: Cryptmaster is a dark, ridiculous RPG test of your typing and guessing skills | Ars Technica
<zid>
3.4GB!
vdamewood has quit [Quit: Life beckons]
<gsekulski>
ddevault where could I find `nullable` implementation?
<zid>
I has, a item
gsekulski has quit [Ping timeout: 268 seconds]
<nikolar>
what did gsekulski mean
<GeDaMo>
Possibly asking how 'nullable' is implemented in Hare?
<zid>
GeDaMo: I beated the demp
<GeDaMo>
Is it good?
<zid>
salright?
Matt|home has quit [Quit: Leaving]
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<heat>
netbsduser, here's another awful fact: MAP_SHARED doesn't need to allocate blocks on a write-protected fault
<heat>
now, you'd think: oh heat, that's obvious, POSIX is very lax
<heat>
well, here's this: some linux filesystems (including ext2!) don't allocate blocks on a fault
vdamewood has joined #osdev
<netbsduser>
heat: that one surprises me much less, actually i even thought there might be a rule against it
<heat>
doing block allocation properly is good, although i *think* there's a trick here
<heat>
say you write-fault the shared mapping, it allocates up to i_size (obviously you don't want to allocate over i_size). then you move i_size, then write more stuff
<heat>
so if i_size expands the file you might need to be careful and write-protect that page again
zetef has joined #osdev
kfv has joined #osdev
gsekulski has joined #osdev
CryptoDavid has quit [Quit: Connection closed for inactivity]
leg7 has quit [Remote host closed the connection]
ZombieChicken has joined #osdev
carbonfiber has joined #osdev
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Gooberpatrol66 has quit [Ping timeout: 268 seconds]
kfv has joined #osdev
teardown_ has quit [Remote host closed the connection]
teardown has joined #osdev
kfv has quit [Ping timeout: 252 seconds]
Matt|home has joined #osdev
spareproject has quit [Remote host closed the connection]
Gooberpatrol66 has joined #osdev
kfv has joined #osdev
kfv has quit [Remote host closed the connection]
kfv has joined #osdev
zetef has quit [Remote host closed the connection]
Ram-Z has joined #osdev
kfv_ has joined #osdev
kfv has quit [Ping timeout: 268 seconds]
zetef has joined #osdev
gsekulski has quit [Ping timeout: 264 seconds]
kfv_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zetef has quit [Remote host closed the connection]
zetef has joined #osdev
ZombieChicken has quit [Ping timeout: 260 seconds]
ZombieChicken has joined #osdev
kfv has joined #osdev
geist-sdf has quit [Quit: Lost terminal]
sbalmos has quit [Quit: WeeChat 4.2.2]
sbalmos has joined #osdev
d5k has joined #osdev
d5k has quit [Client Quit]
aktaboot has joined #osdev
<aktaboot>
hey, I'm having a hard time finding the code of listen() in linux/net.h
Gooberpatrol66 has quit [Read error: Connection reset by peer]
Gooberpatrol66 has joined #osdev
fkrauthan has joined #osdev
ZombieChicken has quit [Quit: WeeChat 4.2.1]
gog has quit [Quit: byee]
<ddevault>
gsekulski left, but the nullable "implementation" is spread throughout the compiler code, it implicates the parser, type checker, codegen, etc
kfv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ddevault>
but in essence how it works is that you cannot store null in a non-nullable pointer and you cannot dereference a nullable pointer without checking if it's null
gog has joined #osdev
zetef has quit [Remote host closed the connection]
gbowne1 has joined #osdev
gbowne1 has quit [Remote host closed the connection]
gbowne1 has joined #osdev
<nikolar>
It's pretty simple internation wise
Left_Turn has joined #osdev
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 268 seconds]
<GreaseMonkey>
morning, reading the backlog and... "is [a 32-bit environment] extremely limited compared to a 64-bit enviroment? also yep." <-- looks like i'm the one shaking my cane here, when i started, 64-bit wasn't common... and also a 4 GB space is pretty damn usable... *especially* considering i need real mode compat in my OS lol
<zid>
32GB is extremely limited if you want use a modern computer to do modern things
<zid>
32b* wtf
<heat>
woah look at zid here with his gaming pc
<zid>
If you just wanna run zork then no it's massively over-provisioned
<heat>
mr 64GB of ram
<zid>
nope, 32GB :P
<zid>
of shitty cheap ddr4
<zid>
so it's way worse than my previous machine's memory
<zid>
(dual shit ddr <<< quad expensive ddr3)
<zid>
ddr4*
<nikolar>
i am mr 64gb of memory
<nikolapdp>
or 4mb
<nikolapdp>
pick oe
<nikolapdp>
one
<zid>
4millibits
<nikolapdp>
yes zid, that's what i am talking about
<zid>
I have 274877906944000 millibits of memory
<GreaseMonkey>
if by "modern things" you mean "every app is some code tacked onto a hideously bloated web browser" then yes
<zid>
more or less y ea
<zid>
or media
<zid>
If it's related to media, you're going to want mmap not to die on its arse when you open it
<zid>
"sorry, can't edit this normal ass raw camera picture, I ran out of address space to do it with"
<GreaseMonkey>
ah right
<nikolapdp>
kek
<heat>
the web browser is "bloated" for good reason
<zid>
some small good reasons*
<heat>
no
<heat>
you'd think those thousands of highly skilled programmers know what they're doing
<zid>
They dropped gopher support but support dumb shit like TLS
<heat>
WHAT
<nikolapdp>
what what
<heat>
who needs TLS lol
<zid>
ikr? gopher support GONE
<zid>
They planned to drop ftp too but I think they got overruled by public opinion
<zid>
or maybe they did?
<zid>
ah, 2021
<zid>
ftp gone
<heat>
my chrome doesn't support ftp
<zid>
what we do have though, is the ability to make 3GB of css render wolfenstein
<zid>
thank god
<nikolapdp>
yes
<nikolapdp>
because that's what you need the most
<heat>
why doesn't my chrome support USENET
<heat>
are they fucking STUPID
<zid>
yes
<nikolapdp>
yes
<zid>
seriously though, the WEB CONSORTIUM, adds more megabytes of spec per year
<zid>
than dialup could download
<nikolapdp>
yes
<heat>
good
<heat>
do you realize how fucked their jobs are?
<zid>
It just means there will never ever be a web browser that isn't chrome or firefox
<zid>
ever
<heat>
good
<nikolapdp>
don't forget webkit
<nikolapdp>
it counts, barely
<heat>
i don't need musl browser in my life
<zid>
It's now a larger project than rewriting linux
<heat>
oh god
<nikolapdp>
care to explain how that's good heat
<heat>
suckless browser??
<nikolapdp>
don't get it
<heat>
nikolapdp, easily. you get 2 high quality implementations vs 50 shitty ones
CryptoDavid has joined #osdev
<zid>
The entire like, productivity and lifestyle of several billion people are *hinged* on these browsers, and google has executive control over all of it, yay
<nikolapdp>
or you get 2 high quality implementations or 2 high quality implementation and 50 worse (how worse depending on how bad the spec is)
<nikolapdp>
i'd pick the second, thanks
<heat>
that's not how that works
<zid>
It's absolutely how it used to work
<zid>
firefox and chrome existed, *and also other browsers*
<nikolapdp>
works with desktop environments/window managers
<nikolapdp>
etc
<heat>
the FOSS community is so so so sad they can't fragment the web to shit with shit projects and shit forks
<heat>
LOL
<zid>
No, the web is instead a google garden
<zid>
because we fucking loved it when it was an IE garden I seem to recall
<nikolapdp>
oh yeah let's just give control over most of the worlds computing straight to google
<nikolapdp>
that's better, clearly
<heat>
your opinion is invalid
<zid>
"This website is best viewed in IE 5.x" doesn't need to apply anymore, because *everybody else already gave up on not using chrome*
<zid>
There's not even a need to warn people
<heat>
you just said there are good FOSS DEs
<heat>
i'm not over that
<nikolapdp>
that's your problem heat
<nikolapdp>
plenty of people are happy with gnome, kde, cinnamon etc
<zid>
I have 15 great windowing environments already nikolar
<zid>
They're all built into windows, at the same time
<Matt|home>
in terms of aesthetics personally im a fan of the retro boxy win95/98 look, even if it's not the best im just a sucker for the UI
<Matt|home>
i.. utterly, from the bottom of my heart _detest_ the new windows UI they've been shoving in people's faces. it got horrific with win 8 trying to be a mobile desktop, and now it's just worse in so many more ways
xenos1984 has quit [Read error: Connection reset by peer]
npc has quit [Remote host closed the connection]
Matt|home has quit [Quit: Leaving]
leon has joined #osdev
aktaboot has quit [Quit: nyaa~]
xenos1984 has joined #osdev
<zid>
Time to grab zelda64recompiled before nintendo finds it
<nikolapdp>
yes
<zid>
k got it set up, can now just decide to play a rando at some point