anchor.diff:     open-dev dup 0= IF ." failed to load CHRP boot loader." 2drop 0 EXIT THEN
      >r s" load" r@ $call-method              ( size R:ihandle )
      r> close-dev                             ( size )
  +;
  +
  +\ load from a bootable partition
  +: load-from-boot-partition ( addr -- size )
  +   debug-disk-label? IF ." Trying DOS boot " .s cr THEN
  +   dup load-from-dos-boot-partition ?dup 0 <> IF nip EXIT THEN
  +
  +   debug-disk-label? IF ." Trying CHRP boot " .s cr THEN
  +   1 disk-chrp-boot !
  +   dup load-chrp-boot-file ?dup 0 <> IF .s cr nip EXIT THEN
  +   0 disk-chrp-boot !
  +
  +   debug-disk-label? IF ." Trying GPT boot " .s cr THEN
  +   load-from-gpt-prep-partition
  +   \ More boot partition formats ...
   ;
   
   \ parse partition number from my-args
  
positive.code:    FALSE
  ;
  
  \ load from a bootable partition
  
  : load-from-boot-partition ( addr -- size )
     load-from-dos-boot-partition dup 0= IF
       drop load-from-gpt-prep-partition
     THEN
     \ More boot partition formats ...
  ;
  
  
  
  \ Extract the boot loader path from a bootinfo.txt file
  \ In: address and length of buffer where the bootinfo.txt has been loaded to.
  \ Out: string address and length of the boot loader (within the input buffer)
  
negative.code: 
  0 INSTANCE VALUE partition
  0 INSTANCE VALUE part-offset
  0 INSTANCE VALUE disk-chrp-boot
  
  0 INSTANCE VALUE part-start
  0 INSTANCE VALUE lpart-start
  