1
Lowlevel-Coding / Re: Kann die Binutils nicht compeliren
« am: 24. February 2007, 20:07 »
Danke hat sich aber erledigt. Hab doch Jidders CrossCompiler zum laufen übereden können.
24. November 2024, 01:06
Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.
make[1]: Entering directory `/cygdrive/c/programmieren/Eigene_Projekte/binutils-
2.9/libiberty'
echo "# !Automatically generated from ./functions.def"\
"- DO NOT EDIT!" >needed2.awk
grep '^DEFVAR(' < ./functions.def \
| sed -e '/DEFVAR/s|DEFVAR.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\
n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
grep '^DEFFUNC(' < ./functions.def \
| sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1
\\n#define NEED_\1\\n#endif\\n" }|' \
>>needed2.awk
gcc -c -g -O2 -I. -I./../include -DNEED_sys_siglist -DNEED_basename -DNEED_strsi
gnal ./dummy.c 2>/dev/null
make[1]: *** [dummy.o] Error 1
make[1]: Leaving directory `/cygdrive/c/programmieren/Eigene_Projekte/binutils-2
.9/libiberty'
make: *** [all-libiberty] Error 2
BFD: Binary/stYJ2QrA: warning: allocated section `.text' not in segment
ENTRY(_start)
SECTIONS
{
. = 0x00100000;
__kernel_start = .;
.text :
{
code = .;
*(.text)
. = ALIGN(4096);
}
.rodata :
{
rodata = .;
*(.rodata)
. = ALIGN(4096);
}
.data :
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .;
*(COMMON)
*(.bss)
. = ALIGN(4096);
}
__kernel_end = .;
}
nasm -f elf -o Binary\asm\start.o Source\asm\start.asm
gcc -c -fleading-underscore -Wall -ffreestanding -nostdlib -fno-builtin -nostdinc -I .\Source\include -o Binary\main.o .\Source\kernel.c
ld -o Binary\kernel.bin -T link.ld Binary/asm/start.o Binary/main.o
int ReadFloppy(int iSector,void *pvBuffer) {
int head,track,sector;
// Compute chs address
sector=(iSector%18)+1;
track=(iSector/18)/2;
head=(iSector/18)%2;
// Enable dma channel
asm("cli");
out(12,0x46);
out(11,0x46);
out(4,(DWORD)pvBuffer & 0xFF); //OFFSET LSB
out(4,((DWORD)pvBuffer >> 8) & 0xFF); //OFFSET MSB
out(0x81,(DWORD)pvBuffer >> 16); //PAGE
out(5,511 & 0xFF); //SIZE-1 LSB
out(5,511 >> 8); //SIZE-1 MSB
out(10,2);
asm("sti");
FloppySeek(track);
FloppyMotorOn();
// Send read command
fd_sendbyte(0x66);
fd_sendbyte(head << 2);
fd_sendbyte(track);
fd_sendbyte(head);
fd_sendbyte(sector);
fd_sendbyte(2); // bytes per sector
fd_sendbyte(18); // Sectors per track
fd_sendbyte(0x1B);
fd_sendbyte(0xFF);
WaitFloppy(0);
int i;
for(i=0;i<10000;i++);
FloppyMotorOff();
return 1;
}
char* fatbuff = malloc(512);
ReadFloppy(18,fatbuff);
nasm -f obj -o load.o load.asm
gcc -ffreestanding -c -Os -o ckernel.obj kernel.c
pause