Page 2 of 2

Re: VESA Help

Posted: Thu Dec 10, 2015 3:25 pm
by iansjack
Don't worry. People will stop answering long before you get to 1000.

Re: VESA Help

Posted: Thu Dec 10, 2015 3:40 pm
by cheapskate01
iansjack wrote:Don't worry. People will stop answering long before you get to 1000.
LoL. :mrgreen: Will you answer my first few questions then?

Re: VESA Help

Posted: Thu Dec 10, 2015 4:32 pm
by iansjack
I'm sure that somebody will. But the answer may just be a link to the Wiki or even a "look in the Wiki". You are well advised to make efforts to find the answer to your questions yourself first.

Re: VESA Help

Posted: Thu Dec 10, 2015 4:44 pm
by cheapskate01
My first two are about printing text to screen:

In Barebones tutorial, where is the pointer to 0xB8000? I'm assuming it's terminal buffer.
Secondly, is the pointer included within this code from the Printing to Screen article:

Code: Select all

// note this example will always write to the top
// line of the screen
void write_string( int colour, const char *string )
{
    volatile char *video = (volatile char*)0xB8000; //I think this is where the pointer is intialized, correct me if I is wrong
    while( *string != 0 )
    {
        *video++ = *string++;
        *video++ = colour;
    }
}
Because the two referenced articles handle printing very differently, as the Barebones code references

Code: Select all

const size_t index = y * VGA_WIDTH + x;
terminal_buffer[index] = make_vgaentry(' ', terminal_color);
This is a bit confuzing.
Thanks

Edit: I figured it out myself! it did address the pointer in the code.
Compiles nicley :) Will be changing a lot of it (at least two lines)

Re: VESA Help

Posted: Thu Dec 10, 2015 4:45 pm
by cheapskate01
iansjack wrote: You are well advised to make efforts to find the answer to your questions yourself first.
Oh yeah, I've made myself a rule to only go to the forums if I can just completely not figure it out myself.

Re: OS Help

Posted: Sat Dec 12, 2015 8:12 pm
by cheapskate01
Okay, so I've merged my existing code with a minimal libc and a meaty skeleton style directory system. Now I'm on to paging, and it's been a tad confusing. I've been using Setting_Up_Paging and studying the code a bit. I'm just a bit confused as to what code goes where. for example:

Does this:

Code: Select all

//set each entry to not present
int i;
for(i = 0; i < 1024; i++)
{
    // This sets the following flags to the pages:
    //   Supervisor: Only kernel-mode can access them
    //   Write Enabled: It can be both read from and written to
    //   Not Present: The page table is not present
    page_directory[i] = 0x00000002;
}
Belong in the same document with

Code: Select all

uint32_t page_directory[1024] __attribute__((aligned(4096)));
? Do I have to edit my linker script? can somebody take the time to walk me through setting up paging with a more in depth description of each step?

Thanks

Re: VESA Help

Posted: Sun Dec 13, 2015 5:05 am
by Combuster
So, rather than make 1000 forum threads for questions, can I just turn this one into a place to ask all my questions that probably dont deserve their own topic? Is that within the forum rules?
Asking us 1000 questions in total can't possibly be right (smart questions forum rule). Reusing the same thread for everything can't possibly be right either (off topic forum rule).

This particular fresh question can be replied to with the comment "what happened when you tried it" and "have you read all the instructions" (smart questions forum rule), is not at all covered by the thread title (off-topic forum rule), and explicitly asks for hand-holding (smart questions forum rule) for which the rest of the question seems to be an unguided distraction. Currently, my primary concern is about the real problem actually being "one does not simply understand paging", or is it rather the more fundamental "one does not simply understand programming".

Key thing to be wary of is that you only ever stick to tutorials, you'll never learn to move beyond them. Learning works better when you make your own mistakes, so make those mistakes first. :wink:

Re: VESA Help

Posted: Sun Dec 13, 2015 7:52 am
by cheapskate01
Combuster wrote:
So, rather than make 1000 forum threads for questions, can I just turn this one into a place to ask all my questions that probably dont deserve their own topic? Is that within the forum rules?
Asking us 1000 questions in total can't possibly be right (smart questions forum rule). Reusing the same thread for everything can't possibly be right either (off topic forum rule).

This particular fresh question can be replied to with the comment "what happened when you tried it" and "have you read all the instructions" (smart questions forum rule), is not at all covered by the thread title (off-topic forum rule), and explicitly asks for hand-holding (smart questions forum rule) for which the rest of the question seems to be an unguided distraction. Currently, my primary concern is about the real problem actually being "one does not simply understand paging", or is it rather the more fundamental "one does not simply understand programming".

Key thing to be wary of is that you only ever stick to tutorials, you'll never learn to move beyond them. Learning works better when you make your own mistakes, so make those mistakes first. :wink:
Wow. I heard you had a slick tongue but wow! The way you reply to this stuff just bafflez me! (Compliment)

Anyways, I figured that last part out myself, so I've been trying to stay away from those.
About the second thing you said, How will I know if I made a mistake? Will the compiler just throw an error? How can I tell if I got it right?

Thanks; I like your OS

Re: VESA Help

Posted: Sun Dec 27, 2015 8:12 pm
by cheapskate01
azblue wrote:
One thing I like to recommend is mode 13h.

From Real Mode:

Code: Select all

mov ax, 13h
int 10h
Cool! I remade my kernel in real mode and added a vga command and it totally worked! Thanks. But how do I plot a pixel with just NASM?

Re: VESA Help

Posted: Sun Dec 27, 2015 9:34 pm
by alexfru
cheapskate01 wrote: Cool! I remade my kernel in real mode and added a vga command and it totally worked! Thanks. But how do I plot a pixel with just NASM?

Code: Select all

mov ax, 0x13
int 0x10
mov ax, 0xa000
mov es, ax
mov byte [es:320*100 + 160], 15

Re: VESA Help

Posted: Tue Dec 29, 2015 5:22 pm
by cheapskate01
alexfru wrote:
cheapskate01 wrote: Cool! I remade my kernel in real mode and added a vga command and it totally worked! Thanks. But how do I plot a pixel with just NASM?

Code: Select all

mov ax, 0x13
int 0x10
mov ax, 0xa000
mov es, ax
mov byte [es:320*100 + 160], 15
Thank you! One more little thing, how to draw a line with this pixel stuff without coding each pixel individually?

Re: VESA Help

Posted: Tue Dec 29, 2015 9:08 pm
by neon
Implement a line scanning algorithm (such as midpoint or Bresenham's) and optimize it. Why do you want to limit yourself to assembly language solutions?

Re: VESA Help

Posted: Tue Dec 29, 2015 9:57 pm
by cheapskate01
neon wrote:Implement a line scanning algorithm (such as midpoint or Bresenham's) and optimize it. Why do you want to limit yourself to assembly language solutions?
For now, Its just a bootsector. It'll be fixed later, but I'm just using asm for now, to learn real mode schtuff

Re: VESA Help

Posted: Tue Dec 29, 2015 10:20 pm
by neon
Line scanning algorithms tend to be quite long since it needs to compensate for 8 separate cases during rendering (+/- slope in 4 quadrants); I would not even attempt to put it in the boot sector given the lack of space available. Don't worry about graphics until after the boot sector.

Re: VESA Help

Posted: Tue Dec 29, 2015 10:27 pm
by cheapskate01
neon wrote:Line scanning algorithms tend to be quite long since it needs to compensate for 8 separate cases during rendering (+/- slope in 4 quadrants); I would not even attempt to put it in the boot sector given the lack of space available. Don't worry about VBE until after the boot sector.
Yep. just figured that out ofter adding a 80x50 text mode as another command. I went some 15oo bytes over lol :wink: