OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 12:30 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
 Post subject: Re: How do I load my sector with if it's more than 512 bytes
PostPosted: Thu Aug 17, 2017 8:55 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
stevewoods1986 wrote:
Schol-R-LEA wrote:
And if you pardon my need for external validation, I was specifically wondering what, if anything, you thought of my explanation of x86 segmented memory here. I don't know if it was something you were actually having trouble with or not, but it was clear that I and most of the other posters were having some :roll:


Well, the post suggesting C and GRUB.


In other words... none of my posts.

At no point in this thread did I tell you to use GRUB - I explained, later on, why the others were recommending it, but I never told you to use it. And at no point did I mention C. Unless it was in a previous thread, I can't find anything that even resembles telling you to use C (I never would - I don't intend to use C myself, why would I recommend it to others?). I may have said that you need to be able to read C code, as most of the examples are in C, but that's it.

Unless you mean this post, but that wasn't in C - it was in Fast Assembler, because I had you mixed up with another poster who was using that. The equivalent struc in NASM would be:

Code:
struc text_cell
    .char db 1
    .attrib db 1
end struc


I can see why you would think the FASM directive was C code, though.

I also gave a recommendation on which C compiler for real mode you could use, but that was in the thread actually discussing mixing C and assembly language for your printing test.

The specific post I was linking to? Didn't even discuss boot loaders. It was on how memory works in the x86. Now, you might, as I said, know the subject well enough already, but I wasn't sure, which is why I wrote that post. The fact that others - including myself - were getting turned around when discussing how to set up the segments for the loaded sectors gave me reason to think you could use the refresher, too.

Seriously, this is honestly looking like you are trolling. I am pretty sure that's not your intent, but there's some real communication problems if you aren't, and if nothing else I'd like to know what I am doing wrong so I can fix the problem.

stevewoods1986 wrote:
I think what Mike is saying could be worth a try. Now my next problem is integers :)


Mike? confused I don't know which poster you are talking about.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: How do I load my sector with if it's more than 512 bytes
PostPosted: Fri Aug 18, 2017 2:47 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
iansjack wrote:
It seems to be a common misconception amongst beginners that it's easier to write your own bootloader than to use GRUB. This is incorrect. As we've already seen here, writing your own bootloader involves not simply reading sectors from a disk, but being able to parse the filesystem, find the location of the kernel, and then load the code. Plus you then have to set up the GDT and switch to protected mode. (You have to so that first if you want to load your code above the 1MB point.) And then you have to determine how much RAM you have and where it is located.
I have to disagree. Writing your own bootloader can be easier/simpler. Personally I wrote my own bootloader that simply loads a fixed size from a fixed location on disk to a fixed address in memory. Before that it gets a memory from the BIOS and dumps that somewhere else in memory, to be read by the kernel while it's initialising. Not that hard, probably took me about three hours to write the bootloader (to be fair I had some experience with small bootloaders before) and another day later on to add the support for reading the memory map in the bootloader and parsing it in the kernel.

Why did I do this? Because I wanted to get onto writing the kernel, not fussing with multiboot headers and configuring GRUB. If necessary, I can always replace the boot code later on. I'm pretty sure that GRUB won't work with the design of my OS anyway, because I use a custom filesystem to support some of the important features of my kernel/OS (although I have plans to make it compatible with standard filesystems by storing extra metadata in special files, but this isn't particularly desirable for the boot media itself).

_________________
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 77 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], iansjack and 91 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group