News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Is OSDev using HLA possible?

Started by hackerlabs, May 27, 2010, 07:05:12 PM

Previous topic - Next topic

DarkWolf

Quote from: Sevag.K on June 26, 2010, 02:13:50 AM
grub allows you to load a kernel image directly.  but the kernel has to live in 1mb+


Heh ??

I may have forgotten what you are referring to.
Are you talking about the size of the kernel or it's location in memory ?
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.


hackerlabs

Yep.
I have to make sure that it's located exactly where it's supposed to be - which means 16-bit assembler.

Ugh  :'(

DarkWolf

Quote from: Sevag.K on July 19, 2010, 10:36:20 PM
Location in memory.


That's what I thought you meant.
So I quess what I am asking is why does that still require 16 bit code ?

Aside from controlling your own bootloader, why couldn't someone use GRUB for booting and write a 32bit OS with HLA ?
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

hackerlabs

Quote from: DarkWolf on July 26, 2010, 10:45:34 PM
Quote from: Sevag.K on July 19, 2010, 10:36:20 PM
Location in memory.


That's what I thought you meant.
So I quess what I am asking is why does that still require 16 bit code ?

Aside from controlling your own bootloader, why couldn't someone use GRUB for booting and write a 32bit OS with HLA ?

Okay.
Here's the thing. When a x86 processor is switched on, it's always in real mode - that is, 16 bits.
Intel designed the processor in this manner, to retain compatibility with the 8086.
So, when you write the bootloader, you write it in 16-bit assembly. Then, you switch over to protected mode, and then utilize all the benefits of 32-bit code  :wink

As for using GRUB, yeah, that's possible.
You need to include a multi-boot header in the kernel, so that GRUB recognizes it as a multi-boot compliant kernel, and boots it properly.
That is something which can be easily achieved with HLA code, so...good luck  :U

Sevag.K

Quote from: DarkWolf on July 26, 2010, 10:45:34 PM
Quote from: Sevag.K on July 19, 2010, 10:36:20 PM
Location in memory.


That's what I thought you meant.
So I quess what I am asking is why does that still require 16 bit code ?

Aside from controlling your own bootloader, why couldn't someone use GRUB for booting and write a 32bit OS with HLA ?

i'm not an expert in this, but as far as i know, if you use grub, you can configure it to load your kernel directly (without a 16bit boot loader) into memory that's located at 1 MB or higher in physical memory.  my guess is that grub needs that 1st 1 mb of physical memory for itself.

hackerlabs

Quote from: Sevag.K on July 27, 2010, 06:30:01 PM
Quote from: DarkWolf on July 26, 2010, 10:45:34 PM
Quote from: Sevag.K on July 19, 2010, 10:36:20 PM
Location in memory.


That's what I thought you meant.
So I quess what I am asking is why does that still require 16 bit code ?

Aside from controlling your own bootloader, why couldn't someone use GRUB for booting and write a 32bit OS with HLA ?

i'm not an expert in this, but as far as i know, if you use grub, you can configure it to load your kernel directly (without a 16bit boot loader) into memory that's located at 1 MB or higher in physical memory.  my guess is that grub needs that 1st 1 mb of physical memory for itself.

Shoot. I forgot to mention that.
You just need to take care of two things:
1) The Multi-boot header.
2) Placing the kernel at 1MiB or higher.

That should do the trick  :thumbu