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
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gog has quit [Read error: Connection reset by peer]
gog has joined #osdev
_xor has quit [Ping timeout: 240 seconds]
_xor has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
<geist> j`ey: yah dunno what machine you're running on, but if you tell it to load you over the time of rom or mmio it may not error out and just do what you told it
<geist> and then you just end up running garbage
gog has quit [Ping timeout: 248 seconds]
gog has joined #osdev
smeso has quit [Quit: smeso]
vdamewood has joined #osdev
smeso has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
qubasa has quit [Remote host closed the connection]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
Lumia has joined #osdev
Matt|home has joined #osdev
Lumia has quit [Quit: ,-]
mzxtuelkl has joined #osdev
Matt|home has quit [Ping timeout: 240 seconds]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
the_lanetly_052 has joined #osdev
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
heat has quit [Ping timeout: 272 seconds]
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
eroux has joined #osdev
nur has quit [Remote host closed the connection]
liz has joined #osdev
liz has quit [Ping timeout: 240 seconds]
gog has quit [Ping timeout: 240 seconds]
gog has joined #osdev
srjek has quit [Ping timeout: 272 seconds]
the_lanetly_052_ has joined #osdev
the_lanetly_052 has quit [Ping timeout: 248 seconds]
RAMIII has joined #osdev
<j`ey> geist: i was accidentally running my .elf instead of the flat binary!
gog` has joined #osdev
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
gog has quit [Quit: byee]
gog` is now known as gog
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
the_lanetly_052_ has quit [Ping timeout: 248 seconds]
GeDaMo has joined #osdev
kingoffrance has quit [Ping timeout: 265 seconds]
<geist> oh heh
<j`ey> so weird, I thought I was overwriting a particular memory location (aka my relocation code was wrong).. but then when I used gdb I accidentally saw all memory was ff :D
<clever> gdb also has a compare-sections command
<clever> which will diff what is in ram with what the elf says should be in ram
<clever> not sure how that will interact with relocations though
heat has joined #osdev
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #osdev
puck has quit [Excess Flood]
puck has joined #osdev
Likorn has joined #osdev
SGautam has joined #osdev
Likorn has quit [Quit: WeeChat 3.4.1]
<bslsk05> ​book.systemsapproach.org: Computer Networks: A Systems Approach — Computer Networks: A Systems Approach Version 6.2-dev documentation
gamozo has joined #osdev
dennis95 has joined #osdev
Ram-Z has quit [Quit: ZNC - http://znc.in]
Ram-Z has joined #osdev
gog has quit [Ping timeout: 268 seconds]
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arminweigl has quit [Ping timeout: 276 seconds]
arminweigl has joined #osdev
blockhead has quit []
the_lanetly_052_ has joined #osdev
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
dude12312414 has joined #osdev
jafarlihi has joined #osdev
<jafarlihi> Are per-CPU GDT means per core or per hardware thread?
<jafarlihi> Also how do you run userspace application from LKM and get output?
eroux has joined #osdev
<mrvn> yes. And why should loadable kernel modules run userspace applications?
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
SGautam has quit [Quit: Connection closed for inactivity]
jafarlihi has quit [Ping timeout: 272 seconds]
<heat> in the kernel, CPU usually means hardware thread
<heat> you don't need to distinguish core from thread, apart from the scheduler possibly
<heat> there's a way to create processes from the kernel
<heat> not that you should do it though
<heat> (this second kernel mention means linux kernel)
<mrvn> obviously. The kernel somehow has to start the init process.
<mrvn> well, there has to be a way to create at leastr one process from the kernel
andreas303 has joined #osdev
<j`ey> also the firmware helper processes
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
jafarlihi has joined #osdev
<heat> and possibly a tls helper process
<heat> I dunno how that turned out
mahmutov has joined #osdev
jafarlihi has quit [Ping timeout: 268 seconds]
jafarlihi has joined #osdev
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
<GNU\Andrew> the bootstrapping issue for languages is getting annoying
<GNU\Andrew> The only way to completely penetrate the bootstrapping issue is to compile the compiler with the human brain
<GeDaMo> You'd have to build your own hardware too :P
<jafarlihi> You can't include `cpumask.h` in LKM. How do I know what is includeable in LKM?
andreas303 has joined #osdev
andreas303 has quit [Ping timeout: 272 seconds]
<zid`> It'd be funny to see the bootstrap needed for various projects, basically the full dep tree
<zid`> and then ask the people involved if they are ashamed of themselves or not
kkd has joined #osdev
<zid`> portage gets close but it assumes a bunch of stuff like starting with a pre-compiled binutils
jafarlihi has quit [Quit: WeeChat 3.5]
<sbalmos> hence why I absolutely abhor, and generally endure, anything JS-related
<clever> zid`: nixos's bootstrap starts from a tar containing a pre-compiled busybox+gcc+binutils, but then uses that to re-build everything according to the new package definitions
<clever> and there is a nix package to create a new tar
<clever> so you can still update that seed it starts from
<bslsk05> ​stackoverflow.com: Why Java turns out to be faster than C++ in this simple BubbleSort benchmark example? - Stack Overflow
<mrvn> gcc -O3 is 5 times slower than gcc -O2, which is about the speed of clang++ -O2 but clang++ -O3 is twice as fast again.
<bslsk05> ​godbolt.org: Compiler Explorer
<mrvn> mjg_: not what's going on here though.
<zid`> so does gentoo
<mrvn> gcc -O3 ist just stupid, unrolling loops far too much and such.
<zid`> that tarball is called the stage3
<zid`> there used to be a stage 1 and 2 method too but it's so old I've never tried it, and isn't a thing anymore
<mrvn> clang++ -O2 and -O3 looks like the same code but blocks rearanged a bit because of which side of a branch the compiler figured out is more likely.
<mrvn> zid`: It used to be you needed all of latex to bootstrap Debian. That was a humongous root set.
<bslsk05> ​github.com: nixpkgs/x86_64.nix at master · NixOS/nixpkgs · GitHub
<clever> for nixos, its a ~24mb tar file
<zid`> gentoo's is 200MB but has more stuffs
pretty_dumm_guy has joined #osdev
<zid`> It's a bootable system right out of the gate
<zid`> incl the package manager
<zid`> you just extract it, chroot into it, install all the packages you'll want on your first boot, then reboot
<clever> inside, i see coreutils, gcc, glibc, header files, libcrypt
<clever> yeah, gentoo's stage3 is more of a complete rootfs, with a working toolchain and package manager
<zid`> if you wanna know what's in it I guess :p
<clever> debootstrap can create the same thing, by just unpacking each .deb in the base set, to a defined root dir
<bslsk05> ​gist.github.com: gist:e218d16c5438bb8e6e7f4b48f0546e23 · GitHub
<clever> in this gist, i installed debian on an rpi, with my open firmware
<clever> lines 1-58, fdisk to make all of the partitions
<clever> 59-72, mkfs'ing everything
<clever> 74-82, mounting it all at the right places
<clever> 89-101, debootstrap creating a stage3 like env under that rootfs
<clever> and the special sauce, 104 downloads the .deb for the open firmware, and 107 installs it
<mrvn> and then you need build-essential
<clever> if you wanted to build things, sure
<mrvn> and the closure of packages required to build all other sources.
<mrvn> clever: how else would you bootstrap from source?
<clever> yeah, this is less of a bootstrapping from source, and more just bootstrapping from the official .deb's
blockhead has joined #osdev
nur has joined #osdev
andreas303 has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
FreeFull has joined #osdev
Gooberpatrol66 has quit [Ping timeout: 248 seconds]
SGautam has joined #osdev
srjek has joined #osdev
xenos1984 has joined #osdev
FreeFull has quit [Ping timeout: 246 seconds]
<ddevault> fun fact: globals are shared between threads
<ddevault> took me 10 hours to find the problem -_-
<mrvn> and now you hopefully learned why globals are evil
<ddevault> actually I have operated under the assumption that threads are evil for years
<ddevault> I'm only using them because it's easier to implement than fork for now
<mrvn> you can define thread local globals too
<ddevault> yeah
<ddevault> hare does not support TLS yet
<ddevault> not going to deal with that now
<mrvn> I was just about to say that if you have TLS you have gone far already
heat has quit [Ping timeout: 272 seconds]
<clever> ddevault: and if you dont tag the global with volatile, then gcc assumes nobody is going to change the var on you
<ddevault> not using gcc, so
<clever> and one thread doing `while (continue) { ... }` may not bother re-reading the var
<clever> and will just cache the value in a reg
the_lanetly_052 has joined #osdev
the_lanetly_052_ has quit [Ping timeout: 264 seconds]
Likorn has joined #osdev
<mrvn> clever: tagging the variable as volatile doesn't mean you see someone else changing the var on you
<j`ey> clever: i had that exact bug in a usb stack i was working on
<mrvn> I wonder if the usage of volatile for a signal handler is even sufficient on modern SMP systems.
<mrvn> (with threads)
the_lanetly_052 has quit [Ping timeout: 246 seconds]
dude12312414 has joined #osdev
<gamozo> Morn
jafarlihi has joined #osdev
heat has joined #osdev
jafarlihi has quit [Quit: WeeChat 3.5]
wand has quit [Remote host closed the connection]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
wand has joined #osdev
mzxtuelkl has quit [Quit: Leaving]
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
skipwich has joined #osdev
liz_ has joined #osdev
wand has quit [Ping timeout: 268 seconds]
skipwich has quit [Read error: Connection reset by peer]
<gamozo> I bought the Intel 100gbe nic, can't wait to write a driver
wand has joined #osdev
<geist> yay
skipwich has joined #osdev
<mrvn> what good is only one?
<geist> this is true
<mxshift> dual port with a DAC between the ports is quite useful for development
<mrvn> a DAC?
<mrvn> How does a digital-to-analog converter help you write drivers for a NIC?
<sbalmos> network noise?
skipwich has quit [Quit: DISCONNECT]
<heat> zid`, how deep do you want the bootstrap to go?
<heat> nand2tetris for everything?
skipwich has joined #osdev
<heat> you need to compile your C compiler, and that C compiler needs to be compiled as well, yadda yadda
<weinholt> mrvn, DAC here probably means Direct Attach Copper cable
<heat> you'll end up hand-assemblying a C compiler for the PDP-11
<j`ey> *Rust compiler
skipwich has quit [Remote host closed the connection]
<heat> you cannot write a rust compiler in anything but rust
<j`ey> orly
<heat> because then it's unsafe and you need to rewrite it
<heat> and if you're writing unsafe code, you're not a rust person
skipwich has joined #osdev
<heat> so you never write
<heat> it
<heat> this logic is bulletproof
<j`ey> lojic
<heat> now, realistically, bootstrapping rust is hell
<heat> mrustc does not count here
<mrvn> heat: I only need a C compiler that can produce PDP-11 code. I don't need one that runs on a PDP-11
<heat> but this is bootstrapping
<heat> it should run on that machine
kingoffrance has joined #osdev
<mrvn> I use my 7-mile-boots to bootstrap a PDP-11.
dennis95 has quit [Quit: Leaving]
<sbalmos> the only way to truly bootstrap is with front panel toggles and lots of Blinkenlights[tm]
<mrvn> blue ones, because they are expensive and only high quality hardware has blue LEDs.
<sbalmos> except at night, when they should switch to red
<mrvn> or off
<sbalmos> that'll scare the night shift Ops
mahmutov has quit [Ping timeout: 264 seconds]
<heat> lets port rustc to 4.4BSD
<heat> it's a great idea
<heat> THEN
<heat> WE REWRITE IT ALL IN RUST
<heat> WHOS WITH ME
<j`ey> ill join in
<heat> whew
* \Test_User hands heat some rusty metal and sneaks away
<heat> i was starting to think I was the only rust enthusiast here
<j`ey> linus is too, he said theyre going to start rewriting the linux kernel in it
<sbalmos> you'll have to write a bootstrap rustc in Ada first
<sbalmos> to truly be safe
Burgundy has joined #osdev
<heat> ohhhh nice!!1!!!!!!1!!!!!
<sbalmos> actually I've kinda been meaning to play in Ada just a little bit, given it's what's used for certified avionics
<heat> can't wait to import cargo crates in the linux kernel ❤️
<heat> or maybe import linux as a crate 😲
<sbalmos> eek
<j`ey> unikernel rust linux image docker wow!
<heat> unikernel rust linux image docker KaaS scalable macro-micro-mini-kernel rust rust C bad
SGautam has quit [Quit: Connection closed for inactivity]
<geist> while you're at it, you shoulkd try MISRA C
mxshift has quit [*.net *.split]
ggherdov has quit [*.net *.split]
gdd1 has quit [*.net *.split]
les_ has quit [*.net *.split]
mcfrdy has quit [*.net *.split]
theruran has quit [*.net *.split]
lanodan has quit [*.net *.split]
aejsmith has quit [*.net *.split]
koolazer has quit [*.net *.split]
ngc0202 has quit [*.net *.split]
pieguy128 has quit [*.net *.split]
night has quit [*.net *.split]
aejsmith has joined #osdev
night has joined #osdev
theruran has joined #osdev
koolazer has joined #osdev
ngc0202 has joined #osdev
ggherdov has joined #osdev
les has joined #osdev
pieguy128 has joined #osdev
mxshift has joined #osdev
mcfrdy has joined #osdev
gdd1 has joined #osdev
<heat> i wonder if going the "stupid" processes = threads route is a better option than doing a rigid process -> thread hierarchy
<heat> it should be way more flexible I guess
<heat> all in all, I need vfork
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
andreas303 has quit [Quit: fBNC - https://bnc4free.com]
andreas303 has joined #osdev
y0m0n has joined #osdev
Burgundy has quit [Ping timeout: 240 seconds]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
<heat> are there good books on macOS?
liz_ has quit [Quit: Lost terminal]
<geist> i assume you mean modern macos?
<Ellenor> heat, which versions? 10 and up?
<heat> any really
<heat> the more modern the better
<heat> I'd like to understand how that frankenstein works
<sbalmos> Study NEXTStep/OpenStep?
<sbalmos> But yeah that Mach/Darwin/BSD conglomerate is... interesting
<bslsk05> ​developer.apple.com: Kernel Programming Guide
Lumia has joined #osdev
wxwisiasdf has joined #osdev
Matt|home has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
CaCode has joined #osdev
jimbzy has joined #osdev
liz_ has joined #osdev
<liz_> this is probably trivial, but in C, is it bad practice to qualify variables in file scope with `extern`? the reason i'm wondering is because the extern is implicit in file scope