<kof673>
somewhere, maybe gunkies, i had a page listing a few old uniecs that were "self hosting" (that is, had source to self build) and some that needed "cross compiled" (from another old unix) ..
<kof673>
*i had saved, did not write,
<heat_>
the 4.3BSD has the full source code but i can't build it :( you probably need root
<nikolar>
kek
<geist>
yeah. i mean the 2.11BSD i have set up on my PDP11 is self hosting
<geist>
but 2.11 is a weird modernday extension of 2BSD, so it's also oddly 'ahead' of the older 4.3BSD and whatnot
<geist>
at some point i sat down to try to install 4BSD on one of my vaxen, but it's extremely involved
<geist>
some day i will retry that
<nikolar>
i guess your best bet for now is netbsd
<geist>
yep, though a modern netbsd wont fit. so i have netbsd 3 on my vax
<geist>
but honestly if you go that far back into netbsd it's not *that* much different from 4.4BSD
<geist>
it's just like 5 year old fork at that point
<geist>
i think i picked netbsd 3 somewhat arbitrarily, i think it was just after it switched to ELF so things aren't statically linked, or somethingl ike that
<geist>
but yet to get too giantic
<gog>
unix svr :3
<nikolar>
neat
<heat_>
a.out had crude shared library support
<geist>
yeah i think so too
<geist>
a.out gets hate but it does what it sets out to do
<geist>
i can imagine a lot of folks thinking ELF was ridiculously overengineered at the time
<geist>
though the fact that it's still totally usable now is a testament to its design
<heat_>
COFF was worse wasn't it?
<heat_>
ELF was like a scaled down COFF
<nikolar>
do binutils even support aout nowadays
<nikolar>
like can i build a gcc 14.2 + binutils for aout on amd64
<heat_>
a.out is not a core file format, it's not a relocatable file format, it doesn't support 50 trillion extensions and different ways to layout a program
<heat_>
it just loads a fuckin program
<heat_>
.text support and .data support and relocations support (sometimes!)
<heat_>
and that's that. perfect.
<nikolar>
exatcly why i ask!
<geist>
there was some sort of extension for 2.11bsd that's interesting though where it can optionally include separate pagedout overlays to get teh cpu to access more than 16 bits of code/data
<geist>
in addition to split code/data
<geist>
i have no idea how that was encoded, and/or if it was a gigantic hack on top of a.out
<nikolar>
probably yes lol
<nikolar>
or did you mean the kernel swapping out it's top page to have more room for drivers
<geist>
that's a generic feature, you can do it for user space programs too
<nikolar>
really
<geist>
and also the split code/data thing, i had to do that to compile nyancat
<nikolar>
that i didn't know
<geist>
since the data is basically like 64k
<nikolar>
that i did know
<nikolar>
kek
<geist>
presumably the compiler or linker generates thunks that makes some syscall to swap it
<geist>
and threads were far i the future of lala land
<nikolar>
the linker does i think
<geist>
who needs threads? silly shit
xenos1984 has joined #osdev
<nikolar>
i read it about it when i was building my kernel
<heat_>
what's a thread?
<geist>
right
<nikolar>
good qestion
<geist>
i gues the only real issue with that (assuming no threads) is where signal handlers lie
<nikolar>
it only swaps out the top page
<geist>
i guess if they always are in the base page it Just Works, except returning from signal the kernel will need to swap the overlay back in
<nikolar>
so you're fine i guess lol
<geist>
in case it interruped something in the overlay
<geist>
*or* tyou're not allowed to call any code in the signal handler in any of the overlays
<nikolar>
probably that
<heat_>
good news nikolar
<geist>
functionally similar to the kernel and taking real IRQs
<bslsk05>
github.com: binutils-gdb/bfd/i386aout.c at master · bminor/binutils-gdb · GitHub
<heat_>
we might be in business.
<geist>
but yeah i think it's just a header and you go to town
<nikolar>
heat_: that's just gdb though, no?
<nikolar>
geist: kek
<geist>
i'm sure it was never extended to 64bit and presumably doesn't really have any arched specific bits
<heat_>
nikolar, nope this is bfd
<geist>
nah that's binutills. oddly for a reason i've never understood, binutils and gdb share the same git repo
<nikolar>
it's so simple that it's probably trivial to extend to 64 bits
<geist>
same repo, but two different tracks of commits
<nikolar>
ah kek, didn't realize taht
<nikolar>
i just got the tarballs
<geist>
which you can do... but i dunno why
<heat_>
oh geist have you seen the new binutils version?
<heat_>
they're cutting out gold :(
<geist>
yah there was a thread at work about that. basically no one maintains it, so there ya go
<geist>
and that's why yu shouldn't take code from big corporations
<nikolar>
was it even used for anything
<geist>
they get bored and move on
<nikolar>
in the last like 10 years
<heat_>
add it to killedbygoogle.com
<nikolar>
kek
<geist>
yep. google is hard on llvm now
<geist>
so binutils is for geezers and neckbeards
<geist>
so it goes in the docs
<nikolar>
geist: does that mean it will outlive google :P
<geist>
heh
<geist>
i do think the regular linker got better such that the adantage wasn't as great?
<heat_>
yes
<nikolar>
ye
<nikolar>
heat mentioned it a couple of times
<geist>
i dont know the full story, but either way there's no much value to it anymore. the original value was probably the stadnard 'if i start a new thing that does 10% of the old thing it's a lot faster for my use case'
<heat_>
i think gnu gold was around equally as capable
<heat_>
just buggier
<geist>
but fast!
<heat_>
yeah
<geist>
or at ieast i think in the use cases google probably cared about
<kof673>
m68k-jaguar-aout-gcc-3.3.6 pdp11_aout_binutils_2201_gcc_412 older stuff still had it :D
<heat_>
if you think about it the fancy linker features are always used by chrome
<geist>
which was linking giantic static binaries
<heat_>
yep
<kof673>
jaguar i don't think you need it, but maybe to link with "official" stuff
<heat_>
gigantic chrome binary, but string dedup'd, fully checksummed, with LTO, and reversed
<geist>
that, and also the interla google stuff is generally the same thing
<geist>
gigantic sttically linked binaries
<geist>
deploy an app? copy the binary, done.
<heat_>
except for glibc because you can't statically link it :v
<geist>
probalby no comment (though i dont actually know)
<geist>
but yeah probably
<nikolar>
now, how do i set an executable format for binutils lol
<geist>
-O iirc
<geist>
you can get a list of what it supports with --help
<geist>
side note and i haven't done it in a while so it may be broken, but unlike gcc you can actually compile an über version of binutils that supports everything
<heat_>
you need to create a target yourself, that includes aout
<kof673>
there was a configure switch to build a giant binutils supporting "everything" ^^^^^
<kof673>
yeah i believe it is more of a "build test" ...
<geist>
yep. i used to do that and just keep one around for reasons
<heat_>
ah okay
<heat_>
geist, yeah i mean you literally cant statically link glibc without being unable to do shit like DNS
<heat_>
it's very funny
<heat_>
They're On It(tm)
<kof673>
i pretty much always build a binutils for a specific target, and then gcc, and keep them together, i.e. similar program-prefix so configure scripts will find them easily
<geist>
heat_: yeah but that presupposes google uses glibc
<heat_>
i would hope so
<kof673>
and then just have to add install_dir/bin to path and use the program-prefix
<heat_>
at the very least it relied on overlaying on top of another libc
<geist>
indeed, however for highly controlled internal binaries you could probably specifically say 'you can only use these apis'
<geist>
and then link to some subset of glibc that doesn't have that problem. i'm just sayin. i have no idea, but when you control the environment that closely, it doesn't even really have to look like linux
<heat_>
they could definitely use musl though, i wouldn't be surprised if someone had a container somewhere in google running musl
<geist>
like i'd probably want internal programs to not go through DNS anyway
<kof673>
--program-prefix sometimes misses some things maybe, but then you get m68k-jaguar-aout-gcc m68k-jaguar-aout-ld etc. or whatever other version information put into program-prefix to avoid conflicts
<heat_>
containers running alpine are super common
<geist>
ilke build your own resolver that feeds into internal caching things, etc
<geist>
or simply disallow DNS because that probably means security issue
<heat_>
yeah
<geist>
i'm actually kinda curious now, will have to ask around tomorrow.i've never worked in that part of the company so i just dont know what that looks like
<heat_>
also statically linking glibc is hilarious because it craps out pretty large executables
<heat_>
statically linking is not for the faint of heart
<geist>
not that i really have a better solution, since per comment quoting is not built into irc
<kof673>
oh, i always prefix quotes with greater than > maybe that...
<kof673>
>>>>>>>>>>>>>
<geist>
>> foobar
<geist>
> foobar
<geist>
oooh a single one does that... weird.
<kof673>
maybe it is trying to line it up :D
<geist>
< baz
<kof673>
like email :D
<geist>
yeah
<heat_>
when are we moving to discord
<geist>
uuuuugh
<kof673>
when there is a bot here to relay :D
<geist>
i mean i dont mind discord per se..
<geist>
and t's not written inRUUUUST
<heat_>
it is actually
<geist>
heh was gonna say far as i know it is
<heat_>
good bits of the backend were rewritten from GOOOOOOOOOOOO to RUUUUUUUUUUUUUUUUUUUST
<nikolar>
EWWWWW
<heat_>
gosh i just hope everything's a crate
<heat_>
a cargo crate
<geist>
well go to rust is probably a pretty clean transfer
<nikolar>
heat_: so you can write your own discord backend by doing cargo add discord-backend@1.23.4
<heat_>
yesss
<heat_>
and you npm the rest
<nikolar>
sounds like a plan
<nikolar>
and we can make our own osdev discord
<geist>
also in general i'm not that big of a fan of having all of that just sitting on some proprietary thing, but then <shrug>
<geist>
like, that's a pretty low issue to have
<geist>
but i still like the openness of irc
<nikolar>
IRC IRC IRC
<nikolar>
geist: the best part, you don't need a gig of ram just to shuffle some bytes around
<geist>
but the feature set is pretty crummy, and i'm already using a proprietary irc client with irccloud, etc
<geist>
and your hobby os can't connect to discord
<heat_>
we gotta have our own mailing list and then struggle with DKIM
<nikolar>
geist: that too
<heat_>
that reminds me geist, how's lk-user?
<heat_>
did you get that up and running?
<geist>
nah havne't futzed with it in a while
<geist>
now i'm doing RUUUUUUST
<heat_>
ruuuuuuuuuuuust in lk when
<geist>
actually i kinda hit up against having to do a propper libc, and i dunno if i have that sort of energy
<nikolar>
port musl or something?
<heat_>
lk and the k stands for krate
<geist>
yeah i was gonna have to port musl, but musl is very linux centric and i hadn't yet decided what i was gonna do re-syscall interface
<heat_>
newlib also works as the poor man's libc
<nikolar>
or that
<geist>
that's what i was using
<geist>
it just has limitations
<kof673>
-lbudgetc
gog has quit [Quit: byee]
Halofreak1990 has quit [Ping timeout: 244 seconds]
pabs3 has quit [Read error: Connection reset by peer]
pabs3 has joined #osdev
cloudowind has quit [Read error: Connection reset by peer]
heat_ has quit [Read error: Connection reset by peer]
eck has quit [Quit: PIRCH98:WIN 95/98/WIN NT:1.0 (build 1.0.1.1190)]
eck has joined #osdev
heat_ has joined #osdev
cloudowind has joined #osdev
surabax has quit [Quit: Leaving]
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
<kof673>
banyan vines was also sysv r3 :/ > VINES was derived from AT&T SVR 3.2, with some modifications.
troseman has quit [Quit: troseman]
Gooberpatrol66 has joined #osdev
<kof673>
banyan vines resurrection page says no known sdk...later moved tog cc........maybe can be borrowed from elsewhere...
<kof673>
*no known surviving copy of sdk
<kof673>
*to gcc
<geist>
oh huh didn't know that. i always assumed it was bare metal kinda like early netware
chibill has quit [Ping timeout: 248 seconds]
<kof673>
i don't know anything about it, just you'd see it in windows networking driver stuff, so i know it was that era :D netware era
<kof673>
i believe windows 95-ish included a "client"
<kof673>
ipx, tcp/ip,.....banyan vines, something or other :D
<geist>
yeah only time i ever actually saw it was when i first interned at Compaq in 1996. they were *still* using it for their print services
<geist>
and i think that was the last thing, they were transitioning email to exchange, etc
<kof673>
the "resurrection page" just says it was shell scripts/curses program, and they'd pay support to remote login perhaps...it was meant to be used by non-unix people i suppose...
<kof673>
but unix underneath.....
chibill has joined #osdev
<geist>
yeah i think it was mostly just a server taht you didn't interact with
<geist>
like novell netware
<kof673>
looks like gov. and military used it........... > banian is a fig that develops accessory trunks from adjacent prop roots, allowing the tree to spread outwards indefinitely.
randm has quit [Remote host closed the connection]
randm has joined #osdev
osmten has quit [Quit: Client closed]
osmten has joined #osdev
Arthuria has quit [Ping timeout: 248 seconds]
Halofreak1990 has joined #osdev
craigo has quit [Ping timeout: 248 seconds]
goliath has joined #osdev
heat_ has quit [Ping timeout: 272 seconds]
aejsmith has quit [Ping timeout: 260 seconds]
aejsmith has joined #osdev
<kof673>
Frequently Asked Questions About Fonts - Are fonts copyrightable? nwalsh.com › comp.fonts › FAQ The short answer in the USA: Typefaces are not copyrightable; bitmapped fonts are not copyrightable
<kof673>
narrator: and thus was the gradius terminal born j/k
Lucretia has joined #osdev
dysthesis has joined #osdev
<cloudowind>
they say it takes 5-6-7 years to learn how to talk and a life time to learn how to shut up :)
<cloudowind>
i am sometimes struggling haha
<cloudowind>
i gave up , i will compile gcc on me desktop instead
Halofreak1990 has quit [Ping timeout: 265 seconds]
hwpplayer1 has joined #osdev
alifib has joined #osdev
sprock has quit [Ping timeout: 244 seconds]
sprock has joined #osdev
<Lucretia>
Anyone know how to get past this? Insufficient debug info for showing source lines at current PC (0x10000c).
<Mutabah>
That's a really low PC, it's probably inside assembly code - so no source lines available
<Mutabah>
Is that from `gdb`? use `disp /i $pc` to get it to display the assembly every time you step
jjuran has quit [Ping timeout: 244 seconds]
jjuran has joined #osdev
<Lucretia>
shouldn't it still have the symbols from the asm though?
jjuran has quit [Quit: Killing Colloquy first, before it kills me…]
jjuran has joined #osdev
eddof13 has quit [Quit: eddof13]
<kof673>
re: a.out https://www.ibiblio.org/pub/linux/kernel/linux-lite-v1.00.relnotes should still run a.out files, and the kernel itself too possibly, but seems to say elf support was "backported" for both kernel and userland binaries > Builds with gcc-2.7.2 are recommended. # not sure what binutils you want, but can try and match gcc 2.7.2 release date :D
<nikolar>
kek til that xv6 has a journaled fs
<nikolar>
so xv6 has on up on openbsd?
<kof673>
"modern" "3 big" bsds i think all have ufs "softupdates" so...not sure how much that is, except "functionality" to some extent
<kof673>
someone else knows more...
<kof673>
a step above "older ufs" perhaps at least...
<kof673>
well, wikipedia says openbsd and netbsd both dropped soft updates :D so perhaps that is right. netbsd "in favor of" WAPBL journaling....... internet says for openbsd: > No definitive replacement has been announced
<nikolar>
yea
hwpplayer1 has quit [Quit: bbl]
hwpplayer1 has joined #osdev
alifib has quit [Quit: .]
hwpplayer1 has quit [Quit: bbl]
<kof673>
i haven't looked at that linuxlite, but i would very much like a toolchain/cross-compiler... boots in < 1M ram, presumably has swap? it could be used just to have a little place to compile other things, and bootstrap something else... just a nice light "base" even if you don't use any code from it ;D
<kof673>
getting anything remotely modern running there is another story perhaps...
<kof673>
but stuff like nasm should be fine, beats dos...
GeDaMo has joined #osdev
dysthesis has quit [Ping timeout: 264 seconds]
<cloudowind>
it took 2 hours 28 minutes to compile gcc with 2 cores i5-7500 CPU @ 3.40GHz
Left_Turn has joined #osdev
Halofreak1990 has joined #osdev
Halofreak1990 has quit [Ping timeout: 252 seconds]
Turn_Left has joined #osdev
osmten has quit [Quit: Client closed]
Left_Turn has quit [Ping timeout: 265 seconds]
hwpplayer1 has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
agent314 has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 276 seconds]
xenos1984 has joined #osdev
surabax has joined #osdev
Halofreak1990 has joined #osdev
q3lont has joined #osdev
q3lont has quit [Remote host closed the connection]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
cow has quit [Remote host closed the connection]
edr has joined #osdev
the_oz has joined #osdev
cloudowind has quit [Ping timeout: 252 seconds]
cloudowind has joined #osdev
cloudowind has quit [Ping timeout: 252 seconds]
cloudowind has joined #osdev
Maja_ has joined #osdev
<nortti>
< kof673> re: a.out https://www.ibiblio.org/pub/linux/kernel/linux-lite-v1.00.relnotes […] ← huh. I for some reason thought that the migration to elf and mainline glibc (libc-6) happened at the same time, but I guess early ELF on linux was still with linux-libc (libc-5)
Halofreak1990 has quit [Ping timeout: 245 seconds]
agent314 has quit [Ping timeout: 244 seconds]
* Lucretia
always hated x86, but at the os dev level it's pure fucking evil. Bring back m68k!
<nortti>
I think several people in here are trying
<Lucretia>
it's a project on my list
<Lucretia>
after I've finished nand2tetris
<nikolar>
lol why hate the x86
<nikolar>
also what exactly do you plan to do with m68k
<jjuran>
Lucretia: Yes, please! o/\o
<Lucretia>
nikolar: x86 is fucking awful really.
<nikolar>
not really
<Lucretia>
nikolar: m68k was my first asm
<jjuran>
<3
<Lucretia>
mips is also nice
<nikolar>
mips is awful
<nikolar>
lol
<nikolar>
to read at least
<Lucretia>
mips makes sense
<Lucretia>
i'll get around to messing with riscv, I have a tang nano 20k which has one on
<Lucretia>
but it's limited
<nikolar>
riscv is about as ugly as mips
<Lucretia>
jjuran: you're an old m68ker?
<jjuran>
Lucretia: Age is relative, but yes :-)
<kof673>
nortti, no idea, the diff on that is 1998, so itself is some kind of "backport" or "trimming". my first linux was a 2-floppy firewall, 2.x surely...
<Lucretia>
jjuran: sun, amiga or atari?
<jjuran>
Lucretia: Mac, actually
<Lucretia>
ah yah
<Lucretia>
yeah
<Lucretia>
forgot about them
dinkelhacker_ has joined #osdev
<jjuran>
I did have an Atari ST first, but I never got to C level on it, much less asm
<Lucretia>
yeah, learnt asm in a week on an a500+
<dinkelhacker_>
So I was wondering if microkernels typically also use kernel stacks or if they can get away with one interrupt stack since they offload all OS services to userspace?
<Lucretia>
had an st before that
<Lucretia>
didn't l3 have a small kernel stack?
<jjuran>
I was still a teenager when I learned just enough asm to do call-through-pointer in Pascal
<dinkelhacker_>
Lucretia : for each thread you mean?
<Lucretia>
dinkelhacker_: not a clue, can't remember
<jjuran>
It was many years later that I learned how to write a stack crawler
<Lucretia>
I didn't get too far into L3 20+ years ago and I'm trying to learn a bit of osdev now
<nortti>
not having a kernel stack means you'd have to be non-preëmptible in-kernel, so would have to use some bounded-time IPC mechanism
<jjuran>
Now I have a simulator that can run some Mac applications
<Lucretia>
yeah, have fs-uae but it's not great.
<nikolar>
Lucretia: i have a rosco_m68k sbc
<nikolar>
i have yet to assemble it
<nikolar>
the plan is to write an os for it too heh
<nikolar>
eventually (tm)
<Lucretia>
was considering trying to buy an "m68k" from aliexpress, not 060
<dinkelhacker_>
nortii: yea that is what i was wondering... it seems like that would be cool to have for more resource constained systems. But I'm not sure if you would get away with not preempting the kernel at all.
<Lucretia>
and trying to build a simple seria+cpu+ram+rom board
<bslsk05>
cliffle.com: On Hubris And Humility - Cliffle
* Lucretia
had a Blizzard 1230-IV bitd which was completely fitted out
<Lucretia>
nortti: so does l4, from what I read the other day
<nortti>
how does it handle SMP?
<Lucretia>
in the upper layer?
<nikolar>
upper layer?
<Lucretia>
well, the l4 people love to whack linux on top
<nikolar>
ah
<Lucretia>
dunno about morphos, but that's l3 based.
<dinkelhacker_>
nortti right! I was wondering if hubris can only do that because it has a much more embedded focus and only runs on micro controllers... like if virtual memory management or things like this would take too long to make it not preemptable.
<nortti>
I honestly cannot say much about preëmptability. I used to think ~everyone did ~always preëmptible, only recently learnt that e.g. linux only does that in-kernel at specifically marked points
agent314 has joined #osdev
<nikolar>
ëëëëë
<nortti>
(well, depending on the kernel config)
<nortti>
< nikolar> the plan is to write an os for it too heh ← yours was a '000 with no MMU, right? what kinda OS design are you thinking of
<nikolar>
no, it's a 030 with an mmu actually
<nikolar>
so nothing particularly exotic on that front
<nortti>
ah okay
<nikolar>
yea
<nikolar>
if i were to do a nommu os, it would be really boring lol
<Lucretia>
apparently, the mmu in the 030 is weird
<nikolar>
how so
* Lucretia
never did any mmu stuff on my miggy, don't know.
<nikolar>
i've read a bit about it and it didn't strike me as particularly weird
<dinkelhacker_>
nikolar you mean "approachable" :D
<Lucretia>
dunno why people on pistorm keep saying it's weird then
<nikolar>
other than different number of entries at different levels of the tree
<nikolar>
but that's not *that* craty
goliath has quit [Quit: SIGSEGV]
eddof13 has joined #osdev
agent314 has quit [Ping timeout: 252 seconds]
agent314 has joined #osdev
agent314 has quit [Max SendQ exceeded]
agent314 has joined #osdev
agent314 has quit [Max SendQ exceeded]
cow has joined #osdev
Brnocrist has quit [Read error: Connection reset by peer]
agent314 has joined #osdev
dinkelhacker_ has quit [Quit: Client closed]
<CompanionCube>
nortti: that's the 'voluntary' preemption mode, there's also a full one
<nortti>
voluntary is the usual default tho, isn't it?
<CompanionCube>
not sure
heat_ has joined #osdev
<heat_>
nortti, CompanionCube, on linux voluntary is the default yes
<heat_>
which is generally good for throughput and server workloads
<heat_>
PREEMPT=y gives you regular preemption semantics in the kernel, and then there are other fun methods like PREEMPT_DYNAMIC=y which allows you to build a single kernel and select the preemption model at boot time with an arg
<PublicWiFi>
I have a dumb question and i've tried googling a bunch but I can't really find a straight answer
<PublicWiFi>
cause I'm a dumdum
<heat_>
have you tried binging it?
<PublicWiFi>
dang you have a point
<PublicWiFi>
;P
<PublicWiFi>
so im moderately decent in C, at least for a hobbyist, but i've never had to use it for homebrew embedded stuffed. only embedded C i've done is with avr or stm stuff so there are a ton of toolchains
<PublicWiFi>
i've never looked at _start before or etc
<PublicWiFi>
i took it all for granted you see
<PublicWiFi>
lol
<PublicWiFi>
ok to my question.. and i'm 100% ignorant here but im gonig to try to articulate this best I can
<PublicWiFi>
I have a homebrew system A, and homebrew system B
<PublicWiFi>
I'd like to write some freestand software to run on both
goliath has joined #osdev
<PublicWiFi>
i understand there is a layer between the actual CPU hardware and the C libraries
<PublicWiFi>
i mean there has to be ya?
<heat_>
probably
<PublicWiFi>
libc isn't quite down to that level right?
<PublicWiFi>
doesn't a libc still rely on some assembler somewhere down teh line?
<zid`>
Not usually
<heat_>
libc has some assembler code
<zid`>
if it does, it's like, a tiny syscall interface thunk
<PublicWiFi>
pretty much what I'm trying to figure out is what I need to do to get my freestanding software to run on both, what is teh "glue" in C?
<zid`>
what glue?
<heat_>
e.g linux _start needs to be written in assembly because the way the main args are laid out to the process is not grokable from C
<PublicWiFi>
both homebrew systems use different CPUs, vintage ones without toolchains
<PublicWiFi>
well that's a lie, but they are on totally diff toolchains
<PublicWiFi>
ehh see I'm sorry
<zid`>
C compiles to machine code, machine code runs on the cpu. The thing you need to do 'different' between each platform is either in a hosted environment: Asking the OS in the right manner, or bare metal, poking the right device
<PublicWiFi>
this is hard to ask because I dunno what I'm trying to ask xD
<PublicWiFi>
yeah teh baremetal stuff
<PublicWiFi>
I'm trying to figure out the layer between my standard library and the baremetal
<heat_>
like, if this is bare metal, then you'll need to figure out what is arch specific, and what is platform (hardware!) specific
<PublicWiFi>
whts its even called from a c perspective
<heat_>
and then you can share the rest
<zid`>
So for example, all of stdio basically just needs 'write bytes' and 'read bytes' implementing, and that's it ported
<PublicWiFi>
they will share pretty much all hardware except the cpu
<PublicWiFi>
okok
<zid`>
for linux you call sys_read and sys_write, for a microcontroller you might read/write to the serial port controller
<PublicWiFi>
but as far as stdio is concerned is calling a function to write/read
<heat_>
practically, no
<PublicWiFi>
so what's that portion called
<heat_>
unless you're using like, newlib
<zid`>
If your libc is portable it's true, if it's not portable it isn't true
<PublicWiFi>
im kind of using newlib as a guide but even its pretty complex for a hobbyist haha
<heat_>
which, fwiw, if you're doing a freestanding embedded thing, maybe newlib is a good option for you
<heat_>
newlib is the least complex libc out there, and easily the most portable, and also probably the worst
<PublicWiFi>
LOL
<heat_>
tradeoffs!
<zid`>
heat loves absolute metrics
<PublicWiFi>
okok lemme try to ask 1 more question
<zid`>
that don't represent the situation
<PublicWiFi>
ok so lets say you have a stdlib that has a write() function that wrties some bytes to some file you opened()
<PublicWiFi>
and write() calls write_byte() or something that has specific cpu code to write a byte
<zid`>
specific platform*
<PublicWiFi>
where is that write_byte() or whatver usually designed
<zid`>
cpu runs machine code, that's all it does
<PublicWiFi>
defined***
<zid`>
your cpu is not your hard drive
<heat_>
usually write() is a system call
<PublicWiFi>
man im sorry im truly failing to articulate this
<PublicWiFi>
lol
<pog>
write() is in the kernel
<zid`>
I think he accidentally aliased
<heat_>
aktshually it's in both :nerdemoji:
<zid`>
not that he meant do a syscall
<PublicWiFi>
xDDD
<PublicWiFi>
i did not
<PublicWiFi>
like linux kernel can be compliled for many differnt archs
<PublicWiFi>
x86, arm, etc
<zid`>
just use a real function name then lol, 'fgetc ultimately boils down to some device specific 'write' call', yes
<PublicWiFi>
but they all use wildly different opcodes and stuff to do things
bauen1 has quit [Ping timeout: 248 seconds]
<heat_>
correct
<PublicWiFi>
so there has to be a layer there that defines that stuff for those archs in particular right?
<zid`>
no
<PublicWiFi>
or i guess that's all comilers
<PublicWiFi>
compiler*
<heat_>
there is
<PublicWiFi>
see I'm stuck in the vintage mindset
<zid`>
Unless you mean "The OS"
<PublicWiFi>
to avoid XY I have a Z80 and a m68k
<heat_>
there's a whole arch/ directory in the kernel that defines stuff for specific architectures and their variations
<PublicWiFi>
I'm writing an OS for the z80, and I thought it would be fun to port it to the m68k
<zid`>
There's no layer between C and the cpu.
<zid`>
Heat.
<heat_>
including a whole layer of inline asembly
<zid`>
inline assembly is not a fucking layer, either
<PublicWiFi>
okok so you think I should just add some ifdefs to the kernel and do the cpu specific definitions there?
<zid`>
you don't need cpu specific anything in a libc
<zid`>
because the cpu *just runs machine code*
<PublicWiFi>
well in my case is KIND OF is, cause these toolchains are ancient and aren'tin a nice neat package like gcc
<PublicWiFi>
well m68k is gcc, but the z80 is a special z88dk compiler
<heat_>
>okok so you think I should just add some ifdefs to the kernel and do the cpu specific definitions there?
<heat_>
yes
<PublicWiFi>
ok haha
<heat_>
that's generally how it is done
<zid`>
If you need it for a *different* reason, then you need it, but the statement "libcs need ifdefs for different cpus" is not true.
<PublicWiFi>
sorry guys I didn't mean to spark debate
<PublicWiFi>
I'm just trying to work around some vintage stuff xD
<nortti>
isn't z88dk sdcc-based? that should follow a model quite similar to gcc
<zid`>
if you have a question or a problem, you'd be better off just asking it
<PublicWiFi>
cause its gonna involve 2 totally different compilers and toolchains
<heat_>
in windows there's the HAL which is actually a little abstracted as a separate layer, though i dont know how that works
<PublicWiFi>
so I was jsut wondering how to structure the code to account for this is all
<PublicWiFi>
nortti: i thikn so!
<zid`>
device access hasn't really changed in 50 years, you write to memory, C has native primites for writing to memory, so you don't need any layers
<zid`>
you just need to run the right bit of code, that writes to the right bit of memory
<PublicWiFi>
I might can add some ifdefs to see what compiler is running maybe
<heat_>
arch/<arch> or if you're gnupilled sysdeps/<arch> or if you're UNIX/BSDpilled usr/sys/<arch>
<PublicWiFi>
if its z88dk's compiler vs gcc for the m68k
<heat_>
or if you're xv6 just lay it out on a single directory it'll be fine i swear
Halofreak1990 has joined #osdev
<nikolar>
heat_: xv6 isn't cross-arch
<nikolar>
don't worry
<nikolar>
it's fine :P
<PublicWiFi>
also
<nortti>
PublicWiFi: you'll likely want to check for the target-specific macros. your compiler manual should contain them
<PublicWiFi>
osdev is tough and awful and really, really fun
<PublicWiFi>
yeah the z88dk documentation is kinda... wild
<PublicWiFi>
its the wild west sort of, at least for me but I'm not intelligent xD
<PublicWiFi>
also I'm gonna try my best at portable threading using co-op method
<nortti>
but generally there's not a lot that needs to be CPU-specific. you'll need some bootstrap code to get an environment where your C code can run, and then stuff like task switching
<heat_>
nikolar, it wasn't crossarch until they tried to port it and probably had to redo a good bit of it
<PublicWiFi>
should be better for vintage cpus that preemp
<nikolar>
heat_: it was never cross arch
<PublicWiFi>
ok so I just need to lean on teh compilers
<nortti>
PublicWiFi: oh, how so?
<nikolar>
and neither is it now
<heat_>
nikolar, yes, now the relevant version is abandoned, and the riscv (because riscv was made @ berkeley) version is maintained
<PublicWiFi>
I'm gonna have all my programs yield() when they are at stopping points
<heat_>
stonks!
<nikolar>
heat_: so not crossarch
<zid`>
"A port existed so it's crossarch" is a fucking weird take, heat
<PublicWiFi>
that way itll be portable and also let me prioritize CPU intensive stuff over slow IO and etc
<nikolar>
zid`: kek
<heat_>
buddy, i'm just saying everyone suffers from not having it crossarch
<PublicWiFi>
guys I didn't mean to start this xDDDD
<nikolar>
PublicWiFi: don't worry, you didn't
<PublicWiFi>
:D
<zid`>
you didn't make heat stupid
<PublicWiFi>
i do appreciate the guideance
<nikolar>
kek
<heat_>
fuck you
<PublicWiFi>
guidance*
<PublicWiFi>
LOL
<PublicWiFi>
shots fired
<nikolar>
welcome to #osdev PublicWiFi
<nortti>
PublicWiFi: I don't think coöperative task switching is any more portable than preëmptive, and both m68k and z80 based systems should have a timer interrupt you can tie to task switching
<heat_>
nortti, why are you so swedish today
<zid`>
that was actually part of some newspapers' style guide in the west
<zid`>
New Yorker
<nortti>
yeah, I've been using the diaeresis in accordance with that rule for a good while now
<bslsk05>
www.arrantpedantry.com: Umlauts, Diaereses, and the New Yorker – Arrant Pedantry
<nikolar>
ö
<zid`>
I can't type em or I might
<nikolar>
weirdos
* nortti
hands zid` a compose key
<nikolar>
english spelling is too broken, adding umlauts won't fix it :P
<zid`>
é
<PublicWiFi>
nortti: yeah you may be right!
<zid`>
I want my j sound to have a letter first
<nortti>
what is your j sound?
<PublicWiFi>
I have preemptive working on my z80 now but I think I can squeeze more performance out of if it if I do co-op
<zid`>
ʒ
<zid`>
It's a sound we have, in english, but we can't type it
<zid`>
it's randomly a j or zh or z or something depending on FEELS
<PublicWiFi>
i have the interrupt running at 60hz (my vsync signal from my vga circuit haha)
<zid`>
/ʒʊʒ,ʒʊʃ/ is an english word, none of which you can type :P
<PublicWiFi>
lol
netbsduser` has joined #osdev
<zid`>
oh I forgot 's'
<nortti>
PublicWiFi: is your problem that a particular task gets finished with its work and then ends up just doing nothing until the next timeslice happens (and as such, if it could call yield(), you could execute other tasks instead)?
Halofreak1990 has quit [Ping timeout: 252 seconds]
<zid`>
zh/j/s
<zid`>
in 'casual' it's just a s
<PublicWiFi>
nortti: yeah a hybrid setup also crossed my mind!
<PublicWiFi>
I haven't got as far in as to figure out how to properly prioritize the different threads
<PublicWiFi>
so right now its just a dumb rotation
<PublicWiFi>
cpu and slow IO get the same time slice
<nortti>
the usual way to get that is, instead of explicit yield calls, to have the operating system keep track of the things the tasks are waiting for
<PublicWiFi>
im very new at all of this so its a huge learning curve
<PublicWiFi>
im having to learn these OS principles AND learn how to do it in z80 asm lol
<PublicWiFi>
but im gonna be porting this to C soon for fun I think, to save work when porting to m68k later on
<nortti>
what resources, if any, have you been using for the OS principles?
<nortti>
also, is the hardware something you've designed yourself?
<PublicWiFi>
osdev mostly
<PublicWiFi>
and vintage forums
<PublicWiFi>
yeah I designed all of the hardware from scratch!
<heat>
Ermine, if you look around for it there's really concrete evidence in favour of those two being the same
<heat>
including lina having accidentally shown a /home/marcan in a stream
<nikolar>
Kek
<nikolar>
And Wikipedia saying that he's the lead of the project
<Ermine>
so that's unofficial
<zid`>
lol is that his
<zid`>
vtube fursona
<nikolar>
Probably
<heat>
youtube weebsona
<gog>
meow
<zid`>
all I remember about hanging out with marcan
<zid`>
is that bushing is dead
<nikolar>
gog: oh we weren't talking about you
<zid`>
which is not very helpful
cloudowind has quit [Ping timeout: 252 seconds]
<Ermine>
anyway, [x] doubt
<gog>
hi
<nikolar>
Oh well who cares
<nikolar>
Hi gog
cloudowind has joined #osdev
divine has quit [Quit: Lost terminal]
<heat>
gog are you linus torvalds
<heat>
dont you lie to me gog
<gog>
yes
<gog>
i'm linux torvald the inventer of lanix
<heat>
im bill gates founder of bing and microsoft teams
<nikolar>
ok bill gates, I have one question
<nikolar>
Why
<heat>
have you asked cortana that?
<nikolar>
I don't Cortana
<nikolar>
I run lanix
<heat>
do you have an xbox 360 kinect
<nikolar>
No
<nikolar>
I have a ps2
<gog>
i do
<heat>
gog lets play fucking kinect star wars!!!!!!!!!!!!!!!!!!!!
<gog>
i use it to control my vtube character
<nikolar>
Linux torvald has a vtube character???
<gog>
yes
<gog>
an anime girl wearing cat ears
cloudowind has quit [Ping timeout: 268 seconds]
cloudowind has joined #osdev
agent314 has quit [Ping timeout: 272 seconds]
cloudowind has quit [Ping timeout: 252 seconds]
cloudowind has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 260 seconds]
Gooberpatrol66 has joined #osdev
Gooberpatrol66 has quit [Client Quit]
cloudowind has quit [Ping timeout: 252 seconds]
agent314 has joined #osdev
cloudowind has joined #osdev
cloudowind has quit [Ping timeout: 268 seconds]
cloudowind has joined #osdev
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
cloudowind has quit [Ping timeout: 260 seconds]
<fedaykin>
cortana is a precursor of corona
<fedaykin>
with windows 2025 license you get a free covid jab
<fedaykin>
to help you get on with the program, lol
cloudowind has joined #osdev
cloudowind has quit [Ping timeout: 252 seconds]
cloudowind has joined #osdev
agent314 has quit [Quit: WeeChat 4.3.1]
cloudowind has quit [Ping timeout: 272 seconds]
cloudowind has joined #osdev
* geist
yawns
Halofreak1990 has quit [Ping timeout: 252 seconds]
<heat>
geist what old unix system are we using today
<geist>
hmm good question
<geist>
misspiggy is fun, that's a PDP/11, think it has unix v6 or v7
<geist>
though i think it's currently running on simh, so not really the same thing
<geist>
three is using SunOS 4.1.1
<geist>
note: *not* Solaris
<geist>
it's an older Sun-3 machine, so it's 68k based
<heat>
i tried IRIX yesterday and it looked broken
<heat>
sunos has a chat at least
<geist>
and cc
<heat>
wooooo
cloudowind has quit [Ping timeout: 244 seconds]
<geist>
it's a BSD derivative, iirc
<heat>
oh yeah
<heat>
wikipedia says 4.3BSD with System V IPC
<geist>
yep
<geist>
then they switched to SVR4 for sunos 5 which they renamed solaris
cloudowind has joined #osdev
<heat>
actually no
<geist>
oh actually no. dang. this is solaris 1
<geist>
you're right, sunos 5 == solaris 2
<heat>
yep, technically solaris!!!
<geist>
solaris 2.x amd then they started calling the X the solaris number after a while
<heat>
cheers mon mjg's crying
<geist>
well there's not much to complain about here. it says sunos 4 had a big kernel lock for SMP. problem solved. all further problems are just that one
<heat>
this one feels quite a good bit slower than the SVR3 one
<heat>
though it might just be latency
<geist>
yeah
<heat>
i quite dislike ssh latency in general even when ssh'ing to a modern system
<geist>
'com' for the chat thing
<geist>
that 'com' or chat thing is basically some SDF specific app they port to everything
cloudowind has quit [Ping timeout: 244 seconds]
cloudowind has joined #osdev
netbsduser` has joined #osdev
hwpplayer1 has quit [Quit: tomorrow is another day]
heat has quit [Read error: Connection reset by peer]
eddof13 has quit [Read error: Connection reset by peer]
heat has joined #osdev
<heat>
ugh kernel seems to have mysteriously crashed
<heat>
and i lost progress in football manager
<heat>
worst. day. ever.
Halofreak1990 has joined #osdev
<nikolar>
Sounds like a feature to me
<heat>
hmm now im wondering, do USB devices need OS intervention to get power?
<heat>
because my mouse wasn't for a few minutes before the full lockup and i'm wondering if its related at all
<nikolar>
What do you mean
<nikolar>
USB devices can wake up your system
<heat>
like, does a USB device Just Get Power or does the OS power it on?
Left_Turn has joined #osdev
goliath has quit [Quit: SIGSEGV]
Turn_Left has quit [Ping timeout: 260 seconds]
<nikolar>
I'd assume USB ports always have power
<nikolar>
You have to initialize the device somehow
<heat>
sure but immediately after powering on your computer you don't have your usb devices powered on it seems
<the_oz>
on my hp proliant 360 or whatever the thing this thing is, if I have a ms lifecam plugged in during bios, it will infinitely loop, but after OS starts it will be ok
<the_oz>
at least in the front facing usb port
<nikolar>
heat: maybe the os hasn't initialized the controller or something
<the_oz>
but also I don't think power works with software intervention, it just knows when there's a draw, hopefully complaiant to hw standard for implementation, and can peg if draw exceeds too much
<kof673>
there are little pass-through contraptions to measure the use of a usb device, find one that passes through data :D
<kof673>
*that also passes through data
xenos1984 has quit [Read error: Connection reset by peer]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 265 seconds]
PapaFrog has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]