An overview of the assembly code in the early Linux kernels https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/old-versions/old/diffs ! ! ld86 requires an entry symbol. This may as well be the usual one. ! .globl _main ! _main: ! #if 0 /* hook for debugger, harmless unless BIOS is fussy (old HP) */ ! int 3 ! #endif mov ax,#BOOTSEG mov ds,ax mov ax,#INITSEG *************** *** 55,71 **** sub di,di cld rep ! movw jmpi go,INITSEG go: mov ax,cs ! mov dx,#0xfef4 ! arbitrary value >>512 - disk parm size mov ds,ax mov es,ax push ax ! mov ss,ax ! put stack at 0x9ff00 - 12. mov sp,dx /* * Many BIOS's default disk parameter tables will not --- 56,80 ---- sub di,di cld rep ! movsw jmpi go,INITSEG go: mov ax,cs ! mov dx,#0x4000-12 ! 0x4000 is arbitrary value >= length of ! ! bootsect + length of setup + room for stack ! ! 12 is disk parm size