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
tacco has quit []
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
no-n is now known as pony
j00ru has joined #osdev
<klange> > It's all about blocking the abuse
<klange> Yes, yes it is!
<GreaseMonkey> klange: wrt sdlquake: it has some weird memory bugs in it that aren't in the original source release, so personally i'd recommend porting that to SDL over actually using SDLQuake
<klange> Or, alternatively, directly to Yutani, though I'm sure others would appreciate a fresh SDL port.
<GreaseMonkey> i recall neaquake at least was popular in the speedrunning scene but it gets rid of the zone allocator and at the same time makes no effort to 64-bit-ify the code so i cannot recommend that port at all
<GreaseMonkey> the zone allocator has the upside that you can get it running on 64-bit with less pain than usual
<GreaseMonkey> although some places put strings into the VM that aren't from the zone allocator, i did manage to get a kludge working which straight up leaked memory in the zone allocator but it did get it to behave properly on 64-bit
pony is now known as lua
<GreaseMonkey> i *think* fteqw has the software renderer? also i know that uhexen2 has the software renderer and i *think* it handles 64-bit as well, but i don't know what it would take to convert that back into quake 1
sprock has joined #osdev
lua is now known as pony
jimbzy has quit [Ping timeout: 252 seconds]
nyah has quit [Ping timeout: 252 seconds]
isaacwoods has quit [Quit: WeeChat 3.2]
CryptoDavid has quit [Quit: Connection closed for inactivity]
srjek has quit [Ping timeout: 260 seconds]
AssKoala has joined #osdev
Izem has joined #osdev
Elbeeo has joined #osdev
AssKoala has quit [Ping timeout: 252 seconds]
<klange> got an audio backend working for my doom port, which was... very different than the Quake one: https://www.youtube.com/watch?v=dr2SVVmrfY4
<bslsk05> ​'ToaruOS 2.0 Doom with Audio' by K Lange (00:00:57)
<kazinsal> nice! now you just need a MIDI playback engine to hear the wonderful not-metallica :)
Elbeeo is now known as AssKoala
<clever> klange: how well do you know lowl-evel arm stuff? ive run into FPU problems again
<klange> The only thing I know about ARM is that my arm no longer hurts from the intramuscular injection I received for my vaccination on Monday.
<clever> heh
mahmutov has quit [Ping timeout: 252 seconds]
fkrauthan has quit [Quit: ZNC - https://znc.in]
fkrauthan has joined #osdev
AssKoala has quit [Ping timeout: 260 seconds]
Izem has quit [Quit: Going offline, see ya! (www.adiirc.com)]
NeoCron has quit [Ping timeout: 260 seconds]
<mjg> klange: no music?
* mjg smells fishy audio
<kazinsal> iirc doom doesn't have an in-engine MIDI "renderer"
<kazinsal> farms that off to a General MIDI equipped sound card driver or similar
<klange> Doom was MIDI, and Quake was CD audio. And Quake PAK distributions don't come with the music.
<klange> So neither of my ports have the music, and most FOSS Quake source ports do not.
<kazinsal> yeah at least with doom the MIDIs are in the WADs
<kazinsal> pretty baked in
<kazinsal> so you get the music in the shareware WAD
<clever> that gives me an idea, implementing a midi engine on the rpi firmware
<klange> The usual approach if there's no system MIDI interface is to bundle timidity and pound it out in software, but that's a bit more work than I want to do right now. I'm happy with the huffing and gunshots.
<clever> ah, timidity might just work as-is
<clever> but modifying it to use the vector core, might make it more efficient
<clever> in the case of the rpi, it doesnt really even have a sound card
<kazinsal> the issue with timidity is that it's GPLed
<clever> all it has is a 2 channel PWM module, and an analog low-pass filter
<klange> kazinsal: Well so are the source releases for Doom and Quake, so *shrug*
<kingoffrance> well, obviously the solution the is just have to use timidity to pre-render and then no more need for midi
* kingoffrance strafes and covers
<kingoffrance> nothing that cant be solved by a layer of indirection, nothing that cant be solved by cheating. ta-mate-o, tuhmaht-o
sprock has quit [Quit: brb]
sprock has joined #osdev
dude12312414 has joined #osdev
GeDaMo has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Arthuria has joined #osdev
Arthuria has quit [Ping timeout: 260 seconds]
fedorafan_altern has quit [Remote host closed the connection]
AssKoala has joined #osdev
dennis95 has joined #osdev
pony has quit [Quit: WeeChat 2.8]
dude12312414 has joined #osdev
AssKoala has quit [Ping timeout: 252 seconds]
isaacwoods has joined #osdev
ahalaney has joined #osdev
drewlander_ has quit [Ping timeout: 265 seconds]
archenoth has joined #osdev
sprock has quit [Ping timeout: 252 seconds]
wolfshappen has quit [Ping timeout: 252 seconds]
wolfshappen has joined #osdev
nyah has joined #osdev
srjek has joined #osdev
dormito has joined #osdev
AssKoala has joined #osdev
Izem has joined #osdev
<Izem> Is there a project on osdev that is relatively easy to build?
<GeDaMo> FreeDOS? :P
<Izem> Like a c compiler and make will get me somewhere
<GeDaMo> Actually, I have no idea how easy it is to build
<Izem> yeah, seems like a large project?
<GeDaMo> What do you want to get out of compiling an OS?
<j`ey> Izem: do you mean an existing OS that is easy to build?
Izem has quit [Ping timeout: 260 seconds]
doppler has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
Izem has joined #osdev
<Izem> GeDaMo: I want to modify and study the sources
<Izem> j`ey: install foo1 foo2; make os
<zid> mine is 'make'
<zid> but also needs *shock* nasm
<Izem> ok that is reasonable
<j`ey> linux is relatively easy to build too
<zid> linux needs a couple of weird things now
<Izem> kconfig is non trivial
<j`ey> you can probably just use a defconfig and be fine
<Izem> that takes around 3-4 hours on my pc
<j`ey> you could look at sortix or toaruos
<zid> I forget where the .txt is now
<j`ey> or xv6?
<Izem> ok, thanks
<zid> kernel needs some things you might not expect, anyway, like openssl for signed modules or something
<j`ey> and flex/bison
<zid> bc I think too in some script
transistor has quit [Ping timeout: 260 seconds]
<Izem> no build instructions for xv6 but the makefile seems simple
<Izem> runs on riscv so I hope gcc riscv stuff is consistent accross distros
<sortie> Izem: My OS Sortix, like j`ey suggests, is actually a good suggestion for what you want. If you download a self-hosting .iso of it, then you can just boot it in a virtual machine and run "make -C /src sysmerge" to completely rebuild and reinstall the OS.
<sortie> If you want to cross-compile it, that's a lot more work to set up the toolchain and such, but the actual OS comes with all the dependencies preinstalled so you can just do that
<Izem> yeah I was just reading development(7)
<sortie> :)
<Izem> tricky, but not tricky at all is figuring out how to work in a vm environment
<Izem> easy way is just ssh I guess
<sortie> The nightly builds have a lot more improvements over the basic 1.0 release with lots of things like common editors and such
<Izem> yeah sortix looks great
<zid> I just use the vm like a desktop
<zid> cus I need to use qemu inside the vm :D
<Izem> ah
<sortie> The 1.0 release and the nightlies don't have networking, as the biggest obstacle. But I do have networking, including ssh client and server, in the secret volatile build. This is an unstable (unofficial but quite stable) preview though
<zid> windows virtualizing linux virtualizing boros, woo :P
<Izem> zid: meta
<Izem> sortie: working on ethernet?
<Izem> that would be the fastest way to networking? or do you mean a whole tcp/ip thing
<sortie> Yes, the volatile preview build has ethernet, IPv4, DNS, UDP, TCP, TLS, SSH, etc.
<Izem> :O
<zid> mine has ethernet, what it doesn't have is tcp :P
<sortie> If you're reading development(7), you're already using Sortix cuz Sortix.org runs on Sortix
<Izem> woah
<Izem> gnarly
<zid> It responds to arp and icmp though and claims to be on every single IP :P
<sortie> Heck I even run my own self-hosting IRC network at irc.sortix.org TLS port 6697
<sortie> Izem: The thing is that the networking support *is not merged*. It hasn't been finished and hasn't been merged yet. I'm working on that, but it is possible to build the appropriate branch or just grab the volatile build to try it out.
<Izem> ok, I checkout and just rebuild in sortix right?
<sortie> But overall it's becoming exactly what you want. A nice self-contained system that one can just boot or install, and then all the tooling is there, all the editors, networking, and it's super easy to play with
<Izem> yeah, that's great
<Izem> perfect timing :)
<sortie> Izem: If you don't need networking, https://pub.sortix.org/sortix/release/nightly/ is the recommended stable release with lots of feature improvements over 1.0. You can get data in and out using e.g. mounting disk images with ext2 or the serial line.
<bslsk05> ​pub.sortix.org: Index of /sortix/release/nightly/
<sortie> If you need networking, use the volatile release instead. It's not promised to be stable but I do my best, but it is the place where I test stuff.
<sortie> Nonetheless my whole infra runs on it
<zid> I should boot my shit up and figure out if I remembered to fix IRQs inside usermode
<zid> I added my gameboy emulator to usermode and they were broken afaik, I forgot to save some reg, but I genuinely don't remember if I fixed it
<j`ey> check git log :P
<zid> idk if I pushed :P
<sortie> Izem: Source-code wise the volatile build uses the 'staging' branch rather than 'master'. This branch is history unstable, I regularly rewrite its history as I perfect the WIP commits. If you build on top of it, be prepared to rebase a lot.
<Izem> interesting
<Izem> I was reading about git recently and I thought that might be a decent solution
<sortie> If you need help with Sortix, there's the unofficial channel #sortix here on this network and the official #sortix channel on irc.sortix.org TLS port 6697
<Izem> oh cool :)
<sortie> Honestly the history rewriting stuff is just me being bad
<Izem> e.g. spelling mistake is a typical trivial commit, you can have a script that prunes or smoothes these commits
<Izem> oh lol
<sortie> I built WAAAAAYYY too much stuff that hasn't merged
<zid> I rebase dev branches a lot, but I tend to avoid rebasing something that's pushed
<sortie> Now it's been a multi year nightmare to clean it up
<zid> lots of urjdi ai siod commits otherwise ;)
<Izem> heh
<Izem> I also need to get a domain name? to use git, my email changes too much
<Izem> does sortix work in vbox?
<sortie> Yep
<sortie> Qemu also
<j`ey> Izem: your email changes too much?
<Izem> ok great
<zid> people use vbox?
<Izem> well I do :P
<sortie> I find vbox more comfortable to use than qemu
<zid> I've used vbox to make a vps box
<sortie> Mostly due to things like ease of full screening
<sortie> Window resizing etc.
<zid> but never to actually.. use for developemtn
<Izem> just curious, is it easier to just use terminals than including graphics primitives from the jump?
<zid> huh
<zid> You're suggesting... writing a compoisting window manager + graphics driver, is easier than implementing 'putchar'?
<Izem> I don't know, and putchar doesn't require a terminal :P
<sortie> The bootloader will place your kernel in some video mode. This can e.g. be the VGA text mode, where you can write direct ascii values to memory locations and it displays that character. Or it can be a graphical framebuffer, where you can draw pixels.
<Izem> yeah, linux uses a terminal emulator
<sortie> E.g. in Sortix, it uses whatever mode the bootloader gives it, and if it's a graphical mode, then the kernel will draw the characters itself using the font
<Izem> it's something like that is what I'm thinking about
<Izem> oh ok
<Izem> same thing happens with sortix, guess I'm going to have to figure out consoles and vga eventually
sprock has joined #osdev
<Izem> illumos has this interesting thing where it get's the text to resize
<sortie> https://wiki.osdev.org/Bare_Bones is the standard intro level osdev tutorial that covers basic things like the VGA text mode (which is super easy to use)
<bslsk05> ​wiki.osdev.org: Bare Bones - OSDev Wiki
<Izem> yeah I did that already
<Izem> I just don't know how to ask the right questions right now
<Izem> sortie: curious, how come you only need a root partition if using gpt?
<sortie> False, you also need a bootloader partition if using gpt (if installing Sortix using its own GRUB bootloader)
<sortie> Note bootloader partition != /boot
<sortie> It's just a reserved space where the actual bootloader is installed
<sortie> But I think I misunderstood your question
<Izem> no you got it
<Izem> I just messed up reading the docs
<sortie> With MBR, you don't need a bootloader partition because it uses a more unsafe approach of storing the bootloader before the first real partition if there's room
<sortie> So GPT is really safer as a design
<Izem> oh ok, is the 1mb hole supposed to be used for the biosboot parition?
<Izem> or is that something else
<sortie> Essentially yeah iirc
drewlander has joined #osdev
transistor has joined #osdev
<Izem> great, it's a pretty smooth install
drewlander has quit [Ping timeout: 252 seconds]
tacco has joined #osdev
tacco has quit []
Izem has quit [Remote host closed the connection]
drewlander has joined #osdev
mahmutov has joined #osdev
drewlander has quit [Ping timeout: 260 seconds]
johnjay has quit [Read error: Connection reset by peer]
johnjay has joined #osdev
travisg has quit [Read error: Connection reset by peer]
AssKoala has quit [Ping timeout: 265 seconds]
geist has joined #osdev
travisg has joined #osdev
elastic_dog has quit [Quit: elastic_dog]
dutch has quit [Quit: WeeChat 3.2]
elastic_dog has joined #osdev
sprock has quit [Ping timeout: 260 seconds]
dutch has joined #osdev
drewlander has joined #osdev
dennis95 has quit [Quit: Leaving]
sprock has joined #osdev
drewlander has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
Izem has joined #osdev
sprock has quit [Ping timeout: 260 seconds]
sprock has joined #osdev
gog has quit [Ping timeout: 265 seconds]
srjek has quit [Ping timeout: 260 seconds]
johnjay has quit [Ping timeout: 252 seconds]
johnjay has joined #osdev
<gorgonical> hey gents, ladies, and various other biological lifeforms of unspecified configuration.
<gorgonical> if you design a microkernel, is there something I'm missing about service discovery?
sprock has quit [Ping timeout: 260 seconds]
<k4m1> there probably is.
<gorgonical> To be clear, the point is that the kernel provides ~10 or so syscalls maybe, I've seen some under 10 IIRC. But let's say you have two memory services, one that does a sort of heap-ish allocation and one that does contiguous memory
<gorgonical> How does an application know which are available? is there some idiomatic solution I'm missing?
<gorgonical> Or is this part of the "do whatever you want" ethos inherent to microkernels
lcars__ has joined #osdev
AssKoala has joined #osdev
<lcars__> hello everyone, I am the author of TamaGo (https://github.com/f-secure-foundry/tamago), I have been trying for some time to register to the wiki/forum without success to add our project to https://wiki.osdev.org/Go, can anyone clarify how to join the wiki (registration emails never arrive) or simply be kind enough to list our project there? Thanks!
<bslsk05> ​f-secure-foundry/tamago - TamaGo - bare metal Go for ARM SoCs (33 forks/1036 stargazers/BSD-3-Clause)
<bslsk05> ​wiki.osdev.org: Go - OSDev Wiki
<gorgonical> geist: do you know who moderates the wiki?
<geist> i think klange does somewhat
<gorgonical> lcars__: klange is in a very distant timezone and is usually on in about 6 or 7 hours
<gorgonical> from my experience anyway
<lcars__> gorgonical: thx, I'll chase them in case
<gorgonical> yep
<GeDaMo> You could try memoserv to send a message
<GeDaMo> gorgonical: maybe one of the syscalls could be a discovery service?
<gorgonical> GeDaMo: I was thinking something like that. Maybe there's a pair of register/list syscalls that allow a service to register with an arbitrary number and a syscall to spit out some info for that same arbitrary number?
<gorgonical> the info could be as simple as simple as a 2-tuple of name and message channel ptr or something
<zid> isn't /Go a bit of a namespace issue
sprock has joined #osdev
<GeDaMo> Or maybe there's a service service, something you can send messages to for information about other services
<gorgonical> But then how do we discover that service? A service discoverer discoverer?
<gorgonical> I don't actually think it's too bad to have exactly one well-known service
<GeDaMo> Standard name maybe
<gorgonical> x86 has this all over the place with magic numbers, etc
<zid> The 'how do discover your discovery information' problem isn't new
<zid> fixed offset, fixed name, etc are common techniques
<GeDaMo> Ma7be a broadcast message along the lines of "does anyone provide this service?"
<gorgonical> zid: Mostly I'm wondering about what fits the design aesthetic of microkernels the most
<zid> something slow and stupid probably :P (runs from thrown shoes)
<geist> lcars__: as far as the owner of the wiki, i think that's a bit of an issue
<geist> from what i understand the owner/operator is kinda MIA
<gorgonical> GeDaMo: That's an interesting idea. Every service has to have a listening channel that these broadcasts come on
<gorgonical> A massive dos target but an interesting mechanism
<GeDaMo> Doesn't DHCP work something like that?
<gorgonical> though it makes a little more sense with an asynchronous, distributed system than a microkernel. feels like a lot of repeated work to have each process scheduled in only to say "lol nope i don't provide that service" for 99% of the replies
<zid> sounds like telnet
<zid> IAC WONT TERMSIZE IAC WONT TERMTYPE IAC WONT ECHO
<GeDaMo> "The DHCP client broadcasts a DHCPDISCOVER message on the network subnet ..." https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#Discovery
<bslsk05> ​en.wikipedia.org: Dynamic Host Configuration Protocol - Wikipedia
<gorgonical> though this overhead wouldn't be such a problem for systems with few processes, such as hpc
<gorgonical> pretty mcuh anything can be amortized away when 99.99999% of your running time is compute
<GeDaMo> You could have a standard library function for name resolution to make it easier to change if you come up with a better method later :P
<zid> Or write a real kernel. (runs from thrown rocks)
<gorgonical> I'd never try to use a microkernel on x86 with its register count
<gorgonical> I'm also a lot more interested in how to move everything a potential application might need for runtime into userspace to avoid all syscall overhead
<gorgonical> Linux already admits this is a problem with vDOs
<GeDaMo> Easy! Just run everything in kernel mode :P
<gorgonical> and ARM64 has some very interesting features that could make it feasible. e.g. you can directly access the cycle counter in user-mode if the kernel lets you
<gorgonical> no need for syscall
<gorgonical> GeDaMo: Hope you don't have any bugs :)
<gorgonical> lol
<GeDaMo> There have been systems which rely on language/compiler to enforce separation
<gorgonical> separation of what? You mean all in kernel-mode but the language "guarantees" safety?
<GeDaMo> Yes
<gorgonical> Hmmmmmmmmmmmm
<GeDaMo> They tend to be single-language systems
<gorgonical> Ada could probably get away with this
<gorgonical> GeDaMo: do you know the names of any of these? I'd like to read up
<zid> GeDaMo: Everything comes back to life and death of javascript talk
<GeDaMo> Lisp machines and Smalltalk come to mind
<gorgonical> ooh. I hadn't really thought of the lisp machines. That's a good point
<bslsk05> ​www.mcjones.org: Pilot
<gorgonical> I guess when the whole language has a built-in debugger as the OS the privilege separation is a little less important
<GeDaMo> And Microsoft had a thing based on the CLR
dormito has quit [Quit: WeeChat 3.1]
<gorgonical> who was it that has that IA32 code snippet they always roll out to show how wacky it is?
<gorgonical> I'm reading IA32 has only seven general purpose registers?
<bslsk05> ​en.wikipedia.org: Singularity (operating system) - Wikipedia
<zid> It has register renaming and a store buffer hooked up to the stack though, so it was at least sorta fast
<gorgonical> oh singularity is like that?
<GeDaMo> "Internal security uses type safety instead of hardware memory protection."
<gorgonical> Bold move microsoft
<gorgonical> So terry davis wasn't that crazy after all it seems
<zid> He was crazy.
<gorgonical> Oh yes, but apparently not for the commodore64-type single aspace design
<zid> I wouldn't recommend saying dumb things like that unless you're prepared to start defending his racist rants
<gorgonical> It's only some light-hearted friday banter, of course he had problems as a schizophrenic
<gorgonical> But people lambaste his OS for being "old and backwards" without understanding the work involved, etc.
<gorgonical> News to me that we actually use single aspace stuff these days
<zid> It is old and backwards
<zid> we don't use it
<gorgonical> Though 2010 for singularity isn't exactly these days
<zid> a couple of research projects proved it was doable
<zid> but we always knew that
<zid> we have hardware memory protection because hardware is fast and not all software can be trusted
johnjay has quit [Ping timeout: 252 seconds]
<zid> It's like saying F1 cars show that bespoke designs that cost $10M to produce each car are how cars should be built
<zid> It's just a completely different domain
<gorgonical> Makes me wonder if singularity actually lets processes etc set flags for memory and stuff that the mmu enforces
<gorgonical> You made a good point that hardware enforcement is better and we can't trust software, but the hardware stuff is still there and you have to work around it
<zid> we don't work around it
<zid> we use it, on purpose
<zid> because we *want* the hardware to enforce it
<gorgonical> I mean in singularity
<zid> when hardware stops enforcing it that's called "Oh god spectre and meltdown help help help"
johnjay has joined #osdev
<gorgonical> those flaws are also the fault of hardware, to be fair
<zid> That's what I just said
<gorgonical> But it's two sides of the same coin, I mean. Correct software behaves incorrectly if the hardware doesn't follow the rules
<zid> When hardware *stops* doing it *for us*, when we stop being able to *rely* on the hardware doing it for us, on purpose, like we want.
<zid> That's a major security problem
<gorgonical> Yeah but that's orthogonal to whether you can put safety into software, isn't it?
<gorgonical> I mean obviously if the hardware is wonky you have nothing
<zid> I was replying specifically to "the hardware stuff is still there and you have to work around it"
<zid> We don't work around it, we need it and use it on purpose
<gorgonical> oh yes, you're right
<gorgonical> But I more meant that even if singularity wants to pretend there isn't an mmu that enforces privileges, there still is. Unless it just doesn't use the mmu at all and sets everything to one aspace with all privileges
<gorgonical> Like some sort of chaotic primordial aspace
<zid> You can use single address space on amd64, but you don't do it by heroically avoiding all the memory protection, you just don't turn it on, and it's just as fast
<zid> and by 'turn it on' I basically mean, manually changing the control reg that contains the page tables
GeDaMo has quit [Quit: Leaving.]
<j`ey> doesnt amd64 need page tables to run in 64 bit?
<zid> yes
<zid> but only 1 set, it's up to you if you wanna do 'syscalls' and have two sets of page tables etc
sprock has quit [Ping timeout: 265 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
jjuran has quit [Ping timeout: 245 seconds]
elastic_dog has quit [Ping timeout: 245 seconds]
jjuran has joined #osdev
elastic_dog has joined #osdev
elastic_dog has quit [Client Quit]
elastic_dog has joined #osdev
junon has joined #osdev
srjek has joined #osdev
gioyik has joined #osdev
<junon> Looking at the Multiboot spec, it states that EAX contains 0x2BADB002 to indicate it's been booted with multiboot as opposed to another bootloader the kernel may support. But... doesn't multiboot prevent you from using any other bootloader given its header requirements?
<junon> I guess I'm struggling to see where EAX having that value be useful outside of a sanity check or assertion.
<junon> would be*
<clever> junon: i remember something about the MB header just needing to be within X bytes of the front of the file, and aligned correctly
<clever> junon: that would let you put a different _start symbol before the header
<clever> so other loaders can just jump directly to the start of the compiled blob
<junon> So it scans for a 32-bit aligned magic number
<junon> Seems... hackish lol. I don't know how else they'd do it though.
<bslsk05> ​wiki.osdev.org: Multiboot - OSDev Wiki
<clever> > The first part of the Multiboot2 header is a struct aligned on an 8-byte boundary containing four "magic" 32-bit integers.
<vdamewood> The only other option would be to specify a specigic format (eg ELF) and to use a specic symbol.
<clever> junon: i think it searches for the 32bit magic, only on 8byte aligned addresses
<clever> and it needs to be within a certain range of the start of the file
<junon> I see okay, so I could put both a multiboot and multiboot2 trampoline in the same image.
<clever> yeah
<junon> neat :) thanks
<clever> and then its just a matter of what order the bootloader checks for them
<clever> i'm guessing whatever it looks for first, and finds, will be used
<junon> right yeah, makes sense
<junon> probably multiboot2 before multiboot, just for that reason.
<clever> but that only works if its searching for MB2 first or both in the same pass
<clever> if it checks for MB1 first, and finds it, it wont bother looking for an MB2 header
sprock has joined #osdev
ahalaney has quit [Remote host closed the connection]
<junon> Right, I'd put mb2 before mb1 since it searches from the beginning, right? If I wanted to prefer mb2 over mb1
<clever> junon: but if the bootloader searches the entire range, for only mb1, and then decides based on the pass/fail if it should search for mb2...
sortie has quit [Quit: Leaving]
<junon> Yeah true but there's no way of getting around that
<junon> Unless you simply build without mb1
<clever> yep
<clever> to know what may happen, youll either need to test, or read the bootloader source
<junon> yeah
solar_sea_ has quit [Quit: Leaving]
Izem has quit [Quit: Going offline, see ya! (www.adiirc.com)]
gioyik_ has joined #osdev
gioyik has quit [Ping timeout: 276 seconds]
elastic_dog has quit [Ping timeout: 245 seconds]
rpb has joined #osdev
gog has joined #osdev
elastic_dog has joined #osdev
<gorgonical> zid: assuming all services and users have 0-copy communication channels, do you think a microkernel is slow cause of the context switch cost? In a single-core system its 4 context-switches, but if you have a service core then an application might not need a context switch at all
<gorgonical> or 2 depending on how you count them
<gorgonical> 1 to switch service/app and 2 to switch them back
<zid> It's slow becuase it does more stuff
<zid> do less stuff if you wanna be fast
<zid> i.e architect it like a normal program
<moon-child> do erlang style
<moon-child> no context switches
<ZetItUp> this might be an odd question, but i guess with modern hardware there is no issue etc, but i read that ~1999, the compilers should atleast support 64k array sizes, should an OS have any kind of protection against trying to declare too big arrays, or just ignore it?
<zid> how does an OS know how big an array is
<zid> is it compiling your source?
<ZetItUp> i mean in malloc etc
no-n has joined #osdev
<junon> At least in some OSes you can request however much memory you want, so long as the address space is there, and the pages won't actually be allocated until a write (or maybe a read, I don't remember). If you dont end up having enough memory, then your program traps.
<zid> smh not supporting my hashdb
<junon> Otherwise, the specified behavior is just to return NULL if the OS couldn't allocate it.
<zid> My hashdb is amazing, you allocate 64TB of memory, then just hash the data, and that's the pointer to it.
<junon> There are no other guarantees; the OS is free to do what it likes.
AssKoala has quit [Ping timeout: 265 seconds]
<zid> If it couldn't allocate it because you deemed it too big, that's on you, I recommend that 640k is too big for anybody
zaquest has quit [Quit: Leaving]
<ZetItUp> yeah i don't really see a case where you need an array that big hehe, but i just thought about it when i read it
<junon> I don't think 64k is too large for malloc to handle in any case, such allocations occur all the time.
<zid> https://cdn.discordapp.com/attachments/417023075348119556/886031915138822144/unknown.png I for one, have never seen a program use more than 640k of memory
<junon> Perhaps for the stack. I actually don't know the typical stack size these days.
<junon> I feel like I'm wrong every time I guess.
zaquest has joined #osdev
<zid> 400*400 images are also far too big for modern monitors
elastic_dog has quit [Ping timeout: 260 seconds]
<junon> So doing a stack allocation for 64k might be asking a bit much, depending. But certainly not malloc.
<zid> it's not like a single 1080p bmp is 8MB
<ZetItUp> how did you even get discord up to 1gb? :D
<ZetItUp> streaming?
<zid> no it just uses ram
<junon> It's electron based
<zid> I have 24GB if it didn't use a gig it's not even trying
<zid> "oh no 4% of my ram!"
<ZetItUp> my discord is using 180MB
<zid> now click all of the channels in all of the servers
<zid> and load all the inline images
<ZetItUp> ok :P
<ZetItUp> got like 20 servers, im only active in 2 :<
<kingoffrance> "should an OS have any kind of protection against trying to declare too big arrays" that sounds like it would manifest in loader/object format, max size of some type of data
<kingoffrance> i mean, i guess theres still limits, just normal person wouldnt run into them?
<kingoffrance> s/object/binary of library...executable.../
<kingoffrance> *or
<kingoffrance> how large does elf let you make something? i think that is where it would be
<kingoffrance> so my understanding, not even c-specific per se
elastic_dog has joined #osdev
<kingoffrance> this raises the question of elf16 to run in 64k lol
<kingoffrance> or whatever the limits might be lol
<ZetItUp> a 32 bit ELF is 4GB
<ZetItUp> as it's limit
<zid> sorta but not really
<zid> nothing's stopping you doing memory banking or things, it's just not really done on PCs
<zid> and C isn't a huge fan of it
<ZetItUp> hm
<kingoffrance> yeah, i read the 8008 has 14-bit addressing, 16kB max addressable ram. BUT you can in/out "swap" from somewhere else to make it unlimited lol
<kingoffrance> you just only get 16k at a time, but you can in/out from wherever lol
<ZetItUp> so a swap file for your binary?
<zid> gameboy has 64k of address space and pokemon is a meg
<gog> gotta allocate them all
<ZetItUp> got me thinking of this video https://www.youtube.com/watch?v=ZWQ0591PAxM
<bslsk05> ​'How we fit an NES game into 40 Kilobytes' by Morphcat Games (00:12:04)
gioyik has joined #osdev
gioyik_ has quit [Ping timeout: 276 seconds]