CC = gcc -m32
LD = ld -m elf_i386
OBJCOPY = objcopy
-OPTFLAGS = -g -Os
+OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
INCLUDES = -include code16.h -I. -I.. -I../libfat
CFLAGS = -W -Wall -ffreestanding $(OPTFLAGS) $(INCLUDES)
LDFLAGS = -T com16.ld
rv = 0x3D00 | mode;
asm volatile("int $0x21 ; setc %0"
- : "=rm" (err), "+a" (rv)
+ : "=abcdm" (err), "+a" (rv)
: "d" (filename));
if ( err )
die("cannot open ldlinux.sys");
while ( count ) {
rv = 0x4000;
asm volatile("int $0x21 ; setc %0"
- : "=rm" (err), "+a" (rv)
+ : "=abcdm" (err), "+a" (rv)
: "b" (fd), "c" (count), "d" (buf));
if ( err || rv == 0 )
die("file write error");
uint8_t err;
asm volatile("int $0x26 ; setc %0 ; popfw"
- : "=rm" (err)
+ : "=abcdm" (err)
: "a" (drive), "b" (buf), "c" (nsecs), "d" (sector));
if ( err )
uint8_t err;
asm volatile("int $0x25 ; setc %0 ; popfw"
- : "=rm" (err)
+ : "=abcdm" (err)
: "a" (drive), "b" (buf), "c" (nsecs), "d" (sector));
if ( err )
uint16_t rv = 0x4301;
asm volatile("int $0x21 ; setc %0"
- : "=rm" (err), "+a" (rv)
+ : "=abcdm" (err), "+a" (rv)
: "c" (attributes), "d" (file));
if ( err )