Keyboard Driver - Keymap problem
Posted: Fri May 30, 2014 6:22 pm
Hi,
I'm working on a basic keyboard driver for my small 32 bit kernel (working GDT, IDT)
Now I have a problem with my keyboard ASCII array.
if I declare my key array the following way:
or
then the corresponding key will be printed out correctly to the console. But if I try to define the array without "static" or "const" then no chars will be printed.
I checked .o file with objdump and with "static" or "const" the variable will be moved to the .rodata section. Without "static" or "const" it will moved to the .data section.
So is there a problem with my .data section?
linker:
I'm working on a basic keyboard driver for my small 32 bit kernel (working GDT, IDT)
Now I have a problem with my keyboard ASCII array.
if I declare my key array the following way:
Code: Select all
static unsigned char keymap[128] = { /* keys*/ };
Code: Select all
const unsigned char keymap[128] = { /* keys*/ };
I checked .o file with objdump and with "static" or "const" the variable will be moved to the .rodata section. Without "static" or "const" it will moved to the .data section.
So is there a problem with my .data section?
linker:
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(RealMode)
entryPoint = 0x00008000;
SECTIONS
{
.text entryPoint : {
*(.text)
}
.rodata : {
*(.rodata)
}
.data : {
*(.data)
}
.bss : {
*(.bss)
}
}