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
jjuran has quit [Ping timeout: 252 seconds]
<Belxjander> I'm not really all that surprised...
<Belxjander> early computing was based in an era when business with interest in automata all wanted market dominance
<Belxjander> the whole market dominance thing is still true... but things have improved somewhat...despite the market having been dumped on a bit
<Belxjander> at least for my own opinion anyway
uplime has left #osdev [/me scurries away]
Belxjander has quit [Ping timeout: 264 seconds]
Belxjander has joined #osdev
mctpyt has joined #osdev
mahmutov has quit [Ping timeout: 252 seconds]
<kazinsal> consider linux distros
<kazinsal> each is a different pile of linux and gnu software and sometimes their own proprietary bits
<kazinsal> but they are all linuxes
<kazinsal> in ye olde days there were a bunch of system v unixes, all of which were at&t unix code and some BSD bits more often than not with their own proprietary software on top
<kazinsal> there are still like four or five svr4 unixes out there still
<Belxjander> thats part of the reason why Linux has had such a large server penetration actually
<kazinsal> yep, red hat got in early and got in deep
<johnjay> why svr4? i thought it wasn't commercial until later
<johnjay> like7
<kazinsal> i wonder what kind of market share canonical holds for paid enterprise linux
<kazinsal> system v was the successor to system iii which was an amagamation of V7 and the various 32-bit vmunixes
isaacwoods has quit [Quit: WeeChat 3.2]
NieDzejkob has quit [Ping timeout: 244 seconds]
NieDzejkob has joined #osdev
skipwich has quit [Ping timeout: 244 seconds]
skipwich has joined #osdev
freakazoid333 has quit [Read error: Connection reset by peer]
<geist> <insert usual unix history tree>
<geist> but yeah SV was an attempt to standardize I believe
<geist> one of many that came later
freakazoid333 has joined #osdev
<geist> ah looks like more of an org chart thing: system 3 and system 5 were another arm of AT&T, outside of bell labs. closed source
<remexre> how do people usually set up testing for their kernel? I have some code I can test by linking it to userspace stuff, some that is kernel-only, and some that I suppose I can test from userspace, but it'd be more effort to put a test harness there
<moon-child> make sure that your userspace tests hit all of your kernel stuff that needs to be hit
<moon-child> imo end-to-end tests are generally preferrable to unit tests when you're not making a library, because they test that your code is actually doing what it should; not that specific modules maintain their APIs
<remexre> so that's the philosophy we do at work, and IMO it sucks because it's way easier to exhaustively test at the unit level, so when you weight too much towards the integ level, code paths not in the tests tend to decay quickly
<remexre> I guess the tests at hand are more things like
<remexre> I want to be sure the disk drivers are indeed making a filesystem that can be read back in, and it feels really gross to e.g. do that test by making a bunch of files then rebooting, rather than being able to do something in-kernel
<geist> combination of both really, but in lieu of either i'd generally go for end to end to make sure you basically work
<geist> and then unit test things that are easily unit testable
<geist> but yes, uilding in things like being able to simulate failures would be a good thing
<geist> like a faulty disk driver, etc
<moon-child> remexre: I mean, I think there is something to be said for unit tests, but broadly I think integration tests are better. And in this case it's much easier to do end-to-end
<moon-child> for fs, you can just unmount and remount, no need to reboot
<moon-child> I mean, at some point if you want to make sure that your fs is reliable, you need to see what happens if you physically unplug the power supply and reboot. There's no quantity of unit tests that will give the same level of confidence that an fs is working as intended
<remexre> geist: yeah, I haven't built that yet, but for disks in particular I was considering doing testing like sqlite does for OOM, where I run the whole test suite with it instrumented to have a disk failure at write number N for all N
<remexre> moon-child: I guess when I say unit tests, I usually mean "semi-exhaustive tests at the unit level," e.g. property tests
<remexre> I agree that if you're only exercising one code path, might as well make it an integration test and save spinning up an extra VM, exercise the memory management code too, etc
<remexre> I *think* my only single-codepath unit tests atm are conformance tests for various algs (e.g. chacha20)
<remexre> My question is more, how should these get wired up outside of the VM
<remexre> right now, it's "for each test, a certain line ends up getting written to the serial port somehow"
<remexre> but I'm not really a fan of that
<geist> indeed. though it's a good start
<geist> especially if you can guarantee lines dont get chopped or whatnot
<remexre> chopped?
jimbzy has joined #osdev
jimbzy has quit [Changing host]
<johnjay> moon-child: what is the distinction between a unit test and an integration test?
zoey has quit [Quit: Leaving]
<jimbzy> I read that as "unit test and an imagination test?" I think I need more coffee, or less coffee. Probably more.
<remexre> johnjay: a unit test tests one logical unit (e.g. the disk driver), an integration test tests the whole integrated system
<johnjay> i guessed it was something like that.
<klange> Integration tests are fundamentally about testing components working together.
<johnjay> i guess the obvious qu estion is how do you write automated test for that
<johnjay> or is it just you use it live
<remexre> usually I see using it live
Sos has quit [Quit: Leaving]
<remexre> e.g. capturing user sessions or making synthetic ones and playing them back against a staging system
<klange> The classic integration test is the smoke test: Run the whole thing, do some stuff, see if smoke comes out.
vin has quit [Read error: Connection reset by peer]
jjuran has joined #osdev
jjuran has quit [Remote host closed the connection]
jjuran has joined #osdev
vin has joined #osdev
Belxjander has quit [Quit: AmigaOS PPC 4.1 +E +U1 // AmIRC 68K]
<kazinsal> layer 3 filtering is in play and is... surprisingly fast
<kazinsal> slowly getting closer to being able to use this as an actual router/firewall
GeDaMo has joined #osdev
doug16k has joined #osdev
Belxjander has joined #osdev
vdamewood has joined #osdev
iorem has joined #osdev
<doug16k> they added a bit of gdbstub magic, allowing you to read/write physical memory from gdb: maintenance packet Qqemu.PhyMemMode:1
<doug16k> 0 puts it back to normal virtual addresses
<klange> mbedtls packaged up again, still had to turn off the socket module because I'm missing a few things in my libc, but it's working nicely
<klange> my cert chain is... probably a bit outdated
<klange> also why the hell am I embedding my cert chain in this app
freakazoid333 has quit [Read error: Connection reset by peer]
sortie has joined #osdev
Vercas has quit [Remote host closed the connection]
Vercas has joined #osdev
warlock has quit [Ping timeout: 268 seconds]
<klange> I ... should work on my package format cleanup again.
<klange> toaru "legacy" had very deb-esque packages with integrated metadata, but when I did the NIH project I had an assortment of different things until I had a tar extractor, and later a deflate inflater, and that weird stuff is still supported and I should throw it away
<klange> current set of packages are tarballs that expect to be extracted into /, much like a deb data archive would be, but I want to add the metadata back
sortie has quit [Quit: Leaving]
<klange> original format used json blobs, and... I have a _two_ json parsers now, and it's really easy to write a JSON dumper in Kuroko (there's one hidden in my wasm IDE)
sortie has joined #osdev
mctpyt has quit [Ping timeout: 244 seconds]
mahmutov has joined #osdev
srjek_ has quit [Ping timeout: 240 seconds]
dennis95 has joined #osdev
Affliction has quit [Quit: Read error: Connection reset by beer]
<meisaka> I made a dhcp client, and it works :D
Affliction has joined #osdev
sortie has quit [Quit: Leaving]
<jjuran> I made my first commit to my git.git fork since 2014 :-)
<jjuran> A subprocess was calling exit() instead of _exit(), which causes problems with the bastardized substitute for fork() I cooked up specifically to get git working
<jjuran> It's basically vfork() except with certain things like fds unshared
<jjuran> exit() destroys the mutable environ storage, which the parent continues to use
<jjuran> (Hilarity ensues)
<jjuran> But it only started crashing after I refactored the environ storage to avoid throwing exceptions
Sos has joined #osdev
ElementW has joined #osdev
iorem has quit [Quit: Connection closed]
<klange> tcp rx is working pretty well in VMs with slirp, not completely failing directly against the real network... and I've got mbedTLS working again.
<doug16k> TCG doesn't do segment limit checks on LGDT
<klange> So, should work on the tx side, get redelivery implemented, maybe do the right windowing stuff...
Burgundy has joined #osdev
Oshawott has quit [Ping timeout: 244 seconds]
<klange> Want to get screenshots uploaded natively again, but it's extra hard now when they're, uh, uncompressed targas.
<klange> The Cairo-backed compositor used libpng and could just dump pngs directly.
mingdao has quit [*.net *.split]
warlock has joined #osdev
Arthuria has joined #osdev
Arthuria has quit [Remote host closed the connection]
Arthuria has joined #osdev
tacco has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
unmanbearpig has quit [Ping timeout: 272 seconds]
brynet has quit [Ping timeout: 272 seconds]
<doug16k> neat: failed to convert GOTPCREL relocation; relink with --no-relax
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<doug16k> ld is an eternal fountain of surprises
<doug16k> nothing to do with GOT, whatsoever. it's moving an immediate absolute address and the symbol for it is is defined in the same assembly source
<doug16k> ah! I need .hidden
<doug16k> nope
<j`ey> lol eternal fountain
<doug16k> I see why - it can't generate a reference to the GOT because relaxation is thinking about making a GOT entry for it, and it can't reach where the GOT would be in this link
<doug16k> even though it wouldn't end up using GOT
<doug16k> can't reach in code32*
<doug16k> --no-relax works
mahmutov has quit [Ping timeout: 264 seconds]
<doug16k> it errored because it *could* have changed it to be a GOT reference that can't link, even though wouldn't have
<doug16k> lol
<klange> I blame interposing for most of my ld nightmares.
sol-86 has joined #osdev
<sol-86> hi all
<GeDaMo> Hi sol-86 :P
<sol-86> lol
<sol-86> here you are
<sol-86> i am writing an operating system from scratch
<sol-86> for a cpu i made
<sol-86> all in assembly as I don't have a compiler yet
<sol-86> it is connected to the internet too
chrysanthematic has joined #osdev
<sol-86> its website is sol-1.org
<sol-86> have a look
Arthuria has quit [Read error: Connection reset by peer]
<sol-86> i am looking for people who want to get involved
<sol-86> its all just for fun
Arthuria has joined #osdev
theruran has quit [Quit: Connection closed for inactivity]
warlock has quit [Quit: leaving]
sol-86 has quit [Quit: Leaving.]
warlock has joined #osdev
tacco has quit []
mahmutov has joined #osdev
f11 has joined #osdev
brynet has joined #osdev
chrysanthematic has quit [Quit: chrysanthematic]
Robbe has quit [Quit: The Lounge - https://thelounge.chat]
Robbe has joined #osdev
piotr_ has quit [Read error: Connection reset by peer]
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
mctpyt has joined #osdev
pretty_dumm_guy has joined #osdev
f11 has quit [Ping timeout: 258 seconds]
Lucretia has quit [Quit: Konversation terminated!]
mingdao has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
tacco has joined #osdev
GeDaMo has quit [Ping timeout: 252 seconds]
Raito_Bezarius has quit [Ping timeout: 264 seconds]
Raito_Bezarius has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
GeDaMo has joined #osdev
freakazoid333 has joined #osdev
srjek_ has joined #osdev
gmacd has joined #osdev
Oli has joined #osdev
freakazoid333 has quit [Read error: Connection reset by peer]
livinskull has quit [Quit: 418 I'm a teapot]
chrysanthematic has joined #osdev
chrysanthematic has quit [Client Quit]
particleflux_ has joined #osdev
particleflux_ is now known as particleflux
particleflux is now known as Guest7886
chrysanthematic has joined #osdev
Guest7886 is now known as particleflux
Mutabah has quit [Ping timeout: 244 seconds]
Mutabah has joined #osdev
Sos has quit [Quit: Leaving]
isaacwoods has joined #osdev
<sham1> Good evening all
ZetItUp has quit []
piotr_ has joined #osdev
johnjay has quit [Ping timeout: 252 seconds]
johnjay has joined #osdev
dennis95 has quit [Quit: Leaving]
f11 has joined #osdev
Beato has quit [Remote host closed the connection]
Beato has joined #osdev
chrysanthematic has quit [Quit: chrysanthematic]
Arthuria has quit [Ping timeout: 265 seconds]
<geist> oh neat, the sol-1 that was linked a while ago is pretty cool
<geist> i'm always a sucker for from scratch TTL things
zoey has joined #osdev
wootehfoot has joined #osdev
wootehfoot has quit [Quit: Leaving]
wootehfoot has joined #osdev
wootehfoot has joined #osdev
wootehfoot has quit [Changing host]
pretty_dumm_guy has joined #osdev
<maksy> ad
zoey has quit [Remote host closed the connection]
zoey has joined #osdev
chrysanthematic has joined #osdev
Arthuria has joined #osdev
freakazoid333 has joined #osdev
Arthuria has quit [Read error: Connection reset by peer]
Arthuria has joined #osdev
<geist> ah the telnet into his os is i think single instance, i telnetted in and saw someone else typing
<geist> neat, chatting with the creator via typing on the shell
sol-86 has joined #osdev
<sol-86> hi
<geist> heya, there you are
<sol-86> hey
<geist> your TTL cpu is super cool
<geist> from looking at the asm it seems to be maybe z80 or 8080 inspired mostly?
<sol-86> yes 8088 inspired
<sol-86> or 8086
Arthuria has quit [Read error: Connection reset by peer]
<sol-86> with virtual memory/supervisor modes added
<geist> looks like a pretty usable ISA
Arthuria has joined #osdev
f11 has quit [Ping timeout: 258 seconds]
<geist> what does the mmu look like? for 64k systems like that something like 16 4K page registers usually works pretty well
<geist> iirc that's what magic-1 does
<geist> or 8 maybe, ecause then you can select with a single 138
<sol-86> its similar to magic-1's
<sol-86> using a RAM table for mapping
<sol-86> and a single 8bit register to keep the process number
<geist> ah interesting, so it has to do an extra memory cycle to ram to translate?
<sol-86> oh no
<geist> (for thos following along, talking about http://sol-1.org/ )
<bslsk05> ​sol-1.org: Sol-1 74 Series Logic Homebrew CPU - 2.5MHz
<sol-86> the virtual address ust goes directly to the page table
tenshi has quit [Quit: WeeChat 3.2]
<sol-86> and tables output goes directly to physical bus
<geist> oh i see, is it a separate table ram then?
<sol-86> yes
<geist> okay, makes sense. yeah that probably scales a lot better than having a bunch of latches hold the page address
<geist> and then having to keep reloading them on every context switch
<sol-86> it is a simple circuit too
<sol-86> using small delay rams
<sol-86> so doesnt add much delay
<geist> omg: http://sol-1.org/images/8_2.jpg that's awesome
<geist> i'd never have enough patience to get to that phase
<sol-86> that was my first cpu, 8 bits
<sol-86> assembled in 2 weeks or so
<sol-86> it was an amazing time lol
<sol-86> good feelings
<geist> yah and as you've probably seen the size of the machine tends to scale exponentially with the width of the busses
<geist> if you scale your thing to 32bit you basically have to recreate a vax 11/780
<sol-86> lol yea
<sol-86> its a lot of wires
<sol-86> how many lines of code in littlekernel?
<sol-86> how long you been developing it?
<geist> since about 2008
<geist> its designed to be fairly minimal, so not going after a lot of features. so it's not always under constant addition
<geist> generally runs on single-address-space embedded cpus
<nur> sigh bochs is weird, confusing, and is making me sad.
<geist> yah that's my general impression
<nur> a kernel that works in qemu just...hangs... in bochs.
<geist> well.... that's not entirely unsurprising
<nur> and the addresses it's showing me don't even make any sense.
<geist> qemu tends to be a little bit more loosey goosey with some of the finer points of the spec, when it's acting as an emulator
<geist> whereas bochs tends to be more of a 'follow the manual precisely, efficiency be damned'
<nur> soooo you're saying the kernel _shouldn't_ work?
<geist> well saying that you probably have a bug and the fact that you can get away with it on qemu but it fails on bochs is not surprising
<sol-86> how much RAM does it need to run? I have 64KB per process on Sol-1
<sol-86> for both data and text that is
<geist> sol-86: minimum build is usually somewhere around 20-30KB text maybe 2K data
<geist> and half of that is a 1K stack
<geist> every thread you added tneds to add another K or so of data
<geist> that'd be for an arm cortex-m class machine
<geist> bigger builds with lots of test code and net stack and whatnot can get up to 200-300KB
<nur> well I'll say this though, osdev makes me a lot sadder than I originally anticipated.
<geist> nur: aww these are fun challenges. see it that way
<sol-86> that sounds good. i'd be able to run it then
<geist> if it works right the first time i'm generally deeply suspicious
<sol-86> i need a quick reboot.
sol-86 has left #osdev [#osdev]
<nur> geist, "everybody falls the first time" like in "The Matrix"
<geist> sure
<nur> thanks :)
<geist> yah dont be discouraged. see this as a sign that you just have a bug to fix. it should be fairly straightforward
<geist> since it works in one but not the other. now you can just figure out what's difference
<geist> easier to debug than nothing works at all
<nur> wait hang on, it didn't hang... it's just... running very slowly.
<geist> ah hah. when using qemu are you using kvm?
<nur> is it still in _grub_?
<nur> geist, no... I don't think so.
<geist> well even qemu TCG emulation should be a few times faster than bochs
<geist> but probably not a few orders of magnitude
<nur> I mean... maybe. But heck qemu is usably fast even when I'm running aarch64 on my x86_64
<geist> right, but remember bochs is a straight emulator, not a jit like QEMU is
<geist> qemu is not an amazing jit, but my generally rule of thumb is it's about 10x as slow as native at the same speed
<geist> whereas bochs is probably about 5x slower than that
<nur> well it should be showing me a grub menu but it's not even getting there
sol-86 has joined #osdev
<nur> it's been... 10 minutes
<geist> well break into it's debugger and see if you can see what the IP is at
<geist> that's definitely too slow
<nur> (0) [0x00000000bdfa] 0008:000000000000bdfa (unk. ctxt): inc edx ; 42
<geist> that's up in the bios area, FWIW
<nur> oh goody
<geist> er wait, no
Arthuria has quit [Read error: Connection reset by peer]
<geist> that's 'low'. was off by a digit
Arthuria has joined #osdev
<nur> Next at t=31257029944
<nur> (0) [0x000000008313] 0008:0000000000008313 (unk. ctxt): mov dword ptr ss:[esp], eax ; 890424
Arthuria has quit [Read error: Connection reset by peer]
<nur> I dunno what it's doing.
<nur> I compiled it with "debug mode"
gog has joined #osdev
Arthuria has joined #osdev
<nur> maybe that makes it go slower?
<geist> it should, but that seems exceptionally slow. if you compile it without debug mode does it work?
<geist> i honestly haven't run bochs in probably 10 years so i dont have handy the details
<nur> well I guess I'll have to make another bochs binary and install it somewhere else
<geist> usually the precompiled ones call it bochs and bochsdbg
<geist> but i do remember the debug builds being somewhat slower
<geist> though nothing particularly bad
<geist> anyway, good luck, but having both copies is probably a good thing
<nur> thanks
<geist> build it twice, one with and without debug
<geist> gotta go do some yard work
* geist waves
Arthuria has quit [Read error: Connection reset by peer]
<nur> bye geist
<nur> thank you
Arthuria has joined #osdev
f11 has joined #osdev
Arthuria has quit [Ping timeout: 265 seconds]
GeDaMo has quit [Quit: Leaving.]
jeaye has quit [Quit: WeeChat 2.7.1]
sol-86 has left #osdev [#osdev]
jeaye has joined #osdev
flx has quit [Quit: Leaving]
flx has joined #osdev
jeaye has quit [Quit: WeeChat 2.9]
jeaye has joined #osdev
sts-q has joined #osdev
srjek_ has quit [Ping timeout: 265 seconds]
ostrich has joined #osdev
wootehfoot has quit [Quit: Leaving]
wootehfoot has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<doug16k> nur, building bochs for debug will make it run much slower. bochs is completely cpu bound
<doug16k> very much slower, I should say
chrysanthematic has quit [Quit: chrysanthematic]
wootehfoot has quit [Quit: Leaving]
ostrich has quit [Quit: WeeChat 3.2]
ostrich has joined #osdev
ostrich has quit [Client Quit]
<geist> doug16k: that being said 10 minutes to still be in grub seems a bit much
<geist> unless i guess it's a compressed image they're trying to load?
<geist> something that requires a lot of cpu
<warlock> doug16k: hey, just wanted to remind ya, that you're the man! thanks for all the help the other day
carmysilna has left #osdev [#osdev]
sortie has joined #osdev
<riverdc> the bootloader I'm using expects the kernel entry point to be at address 0x80000, which I'm setting up with a linker script. when I compile to an elf with gcc and look at the disassembly, the starting instruction is indeed at 0x80000. but when I objcopy it to a plain binary, the starting instruction is the first byte. I expected there to have to be 0x80000 nops first, or something like that. can
<riverdc> someone help me understand this?
<riverdc> here's a paste summarizing ^ : https://paste.ee/p/orolL
<bslsk05> ​paste.ee: Paste.ee - View paste orolL
<riverdc> (this runs fine, I just want to understand better what's going on)
elastic_dog has quit [Ping timeout: 272 seconds]
elastic_dog has joined #osdev
Burgundy has left #osdev [#osdev]
f11 has quit [Quit: Leaving]
<riverdc> nevermind, figured it out, sorry for the noise!
<warlock> even though you say you got it figured out, since you said 0x80000, I guess you're doing arm, anyway, it loads the image directly at that location
<riverdc> yeah, I thought the bootloader *expected* it to be at that location within the image, but as you say, it loads the image *to* that location
<warlock> so the first byte into the file, is aligned at that address
sortie has quit [Quit: Leaving]
<doug16k> nur, extreme slowness can be caused by excessively high or low MIPS setting. if you set it too high, it can help make less interrupts be taken per unit of work completed, but it will also cause loops that spin to pass the time to take extremely long
<doug16k> if you set the mips really low, then loops that spin until time elapses will complete very quickly, but the machine will spend a lot of time in interrupts, due to a lot of time passing per instruction
<doug16k> so you have to set a happy medium
<doug16k> try 1 MIPS to see if it is because there is a loop spinning until some amount of time elapses. that will be very quick on 1 MIPS
<doug16k> try 5-20 MIPS to see if it is because it is spending all of its time in timer interrupts
pretty_dumm_guy has quit [Quit: WeeChat 3.3-dev]
<doug16k> if you thought putting 5000 mips would make it fast, it won't, it will take 7 minutes of real cpu to emulate one second of guest time
<doug16k> guessing your computer can run about 12MIPS of emulation. you can see the rate in the bottom left corner of the bochs window
<doug16k> bochs emulates a magical cpu, where it can execute an instruction every "cycle", and the instruction is one cycle, no matter how difficult it is
<doug16k> nop and fbstp are the same speed
<doug16k> from guest frame of reference
<doug16k> if you measure how many nop and how many fbstp you could do in one second, it's identical to the guest
<doug16k> fbstp is hideously slow, in case you haven't already guessed that
<doug16k> normally
sm2n has quit [Ping timeout: 264 seconds]
<doug16k> riverdc, what you want is actually what you get when the linker screws it up
<doug16k> if you are making a ROM that your address decoder puts at 0xc00000 then the byte at 0xc00000 is at 0 in the rom image
<doug16k> right?
<doug16k> if you want it to screw up catastrophically like that, use gold linker
<doug16k> gold linker is a laugh when you try to make a rom image
sm2n has joined #osdev
<riverdc> > then the byte at 0xc00000 is at 0 in the rom image
<riverdc> yep, that's what I want. but I'm not sure what you mean by the linker "screwing it up". gnu linker seems to be doing exactly what I want
<doug16k> show your objdump -h
<riverdc> just replacing the addresses such that they're correct when loaded at 0x80000
<doug16k> the LMA and VMA work together to tell you why it did that
<doug16k> the LMA for the initialized parts need to be laid out so there aren't any wild gaps
<bslsk05> ​paste.ee: Paste.ee - View paste oPNkj
<warlock> basicly, you got different things, you got the address you're at in memory, and an address in the file, and an address your assembler/compiler believes you to be at
<doug16k> what I mean by "screwing it up" is this: the first initialized byte in your ROM is at offset 2MB, so there are 2MB of zeros at the start of the binary image
<doug16k> but yeah, now I know you want the sane thing
<riverdc> yeah sorry I didn't actually want that ^
<riverdc> I thought that's what the bootloader wanted but I was confused
ghwerig_ has joined #osdev
<doug16k> that looks fine
<doug16k> VMA where the code thinks it is. LMA is where it ends up in the bin file
<doug16k> where beginning of bin file == lowest LMA
ghwerig has quit [Ping timeout: 272 seconds]
<doug16k> so in linker script, .text : { *(.text); ... } >ram AT >rom
<warlock> yea I'm not that good at explaining or using the correct terms but I understand it, cause I'm doing assembler and always building different files by hand
<doug16k> you can cook up total weirdness where it puts .text in some odd place in the rom, puts data in some other odd place, and be able to copy those to some third place (typically ram), with some symbols in the load address space, and others in the final relocated place (ram)
<doug16k> you can have stuff in the load image that you keep using, and stuff you never use again after using the initial image (.data)
<doug16k> it's amazing how well it handles that
<warlock> yea