matches the one used in 32-bit mode.
$(AS) -o $@ $<
%.s16: %.s
- echo '.code16' | cat - $< > $@
+ echo '.code16' > $@
+ sed -e 's/\bcall\b/calll/g' -e 's/\bret\b/retl/g' < $< >> $@
%.s: %.S
$(CC) -x c $(CFLAGS) -Wp,-traditional -E -o $@ $<
* Output to the screen
*/
+#include <stdint.h>
#include "conio.h"
int putchar(int ch)
putchar('\r'); /* \n -> \r\n */
asm volatile("int $0x10"
- :: "a" (0x1400|(ch&0xff)),
- "b" (0x07)
+ :: "a" ((uint16_t)(0x0e00|(ch&0xff))),
+ "b" ((uint16_t)0x07)
: "eax", "ebx", "ecx", "edx",
"esi", "edi", "ebp");
while ( *s ) {
putchar(*s);
count++;
+ s++;
}
return count;
main:
sti
- call setup # Call the C code
+ calll setup # Call the C code
# The setup function returns the drive number,
# which should be returned in %dl
movw %ax,%dx