Re: VESA Help
Posted: Thu Dec 10, 2015 3:25 pm
Don't worry. People will stop answering long before you get to 1000.
LoL. Will you answer my first few questions then?iansjack wrote:Don't worry. People will stop answering long before you get to 1000.
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;
}
}
Code: Select all
const size_t index = y * VGA_WIDTH + x;
terminal_buffer[index] = make_vgaentry(' ', terminal_color);
Oh yeah, I've made myself a rule to only go to the forums if I can just completely not figure it out myself.iansjack wrote: You are well advised to make efforts to find the answer to your questions yourself first.
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;
}
Code: Select all
uint32_t page_directory[1024] __attribute__((aligned(4096)));
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).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?
Wow. I heard you had a slick tongue but wow! The way you reply to this stuff just bafflez me! (Compliment)Combuster wrote: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).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?
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.
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?azblue wrote:
One thing I like to recommend is mode 13h.
From Real Mode:Code: Select all
mov ax, 13h int 10h
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?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
For now, Its just a bootsector. It'll be fixed later, but I'm just using asm for now, to learn real mode schtuffneon 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?
Yep. just figured that out ofter adding a 80x50 text mode as another command. I went some 15oo bytes over lolneon 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.