Hi,
int main()
{
int i;
short int *screen = (short int *) 0xB8000;
char msg[]="Hello World";for(i=0; msg[i] != '\0'; *(screen++) = 0x1F00 | msg[i], ++i);
for(;;);
return 0;
}When i compiled i got a very big main.bin file more then 960MByte, so i
tried to change the char vector with only a char and it works fine. I
think the problem was the buffer overflow protector system that take the
.nodata segment in other address, or something like that... (readelf -S
main)So how can i use the char vector in my programs and build them in standalone
mode?int main()
{
int i;
short int *screen = (short int *) 0xB8000;
char msg = 'H';*screen = 0x1F00 | msg;
for(;;);
return 0;
}gcc -c main.c -o main.o -fno-stack-protector -ffreestand
ld main.o -e main -Ttext 0x1000 -o main
objcopy -R .comment -R .note -S -O binary main main.binRegards
-Alex-
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| Andrew Morton | 2.6.23-rc6-mm1 |
| Eric Paris | [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
git: | |
