VESA Help
Re: VESA Help
Don't worry. People will stop answering long before you get to 1000.
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
LoL. Will you answer my first few questions then?iansjack wrote:Don't worry. People will stop answering long before you get to 1000.
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
Re: VESA Help
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.
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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:
Because the two referenced articles handle printing very differently, as the Barebones code references
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)
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;
}
}
Code: Select all
const size_t index = y * VGA_WIDTH + x;
terminal_buffer[index] = make_vgaentry(' ', terminal_color);
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)
Last edited by cheapskate01 on Thu Dec 10, 2015 6:02 pm, edited 2 times in total.
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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.
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: OS Help
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:
Belong in the same document with
? 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
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;
}
Code: Select all
uint32_t page_directory[1024] __attribute__((aligned(4096)));
Thanks
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: VESA Help
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.
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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.
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
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
Re: VESA Help
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
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
Re: VESA Help
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?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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?
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie
Re: VESA Help
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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
-
- Member
- Posts: 58
- Joined: Sat Aug 01, 2015 9:05 pm
Re: VESA Help
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.
"That I'm in forum signatures is just a sign the invasion of sortie is nearing completion. Soon you'll all have to become me to defeat me." ~ Sortie