News for hackers. Stuff that matters.
Re:X86 boot sector written in C (2010) by userbinator on Friday October 24, 2014 @12:26AM (#8502145)
Going into protmode in the boot sector is extremely early. Most OSs I've seen will stay in realmode (or "unreal" mode) for a little bit longer, so they can use the BIOS to setup some more stuff before making that leap.

Also noticed a minor optimisation:

    mov AL, [SI]    ; pega um byte da string e carrega em al 
    inc SI 

Could've been replaced with a 'lodsb', saving 2 bytes. Ditto for MOV BH/MOV BL with MOV BX. :-)
Re:X86 boot sector written in C (2010) by drv on Friday October 24, 2014 @01:03PM (#8504648)
Going down the size optimization rabbit hole a little bit (not criticism, I just enjoy this sort of puzzle).

Two bytes shorter:

  call print_str
  ret
  =>
  jmp print_str
Three bytes shorter; this one may be a little too clever, since it depends on the low bit of CR0 being 0 initially:

  mov EAX, CR0
  or EAX, 1
  =>
  mov EAX, CR0
  inc AX
Re:X86 boot sector written in C (2010) by mkup on Friday October 24, 2014 @03:38AM (#8502528)
Could've been replaced with a 'cld' and 'lodsb', saving 1 byte.