Just in case we started from a floppy, turn the motors off when done
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 21 Apr 2018 01:30:59 +0000 (04:30 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 21 Apr 2018 01:30:59 +0000 (04:30 +0300)
loading

src/boot/boot2.s

index 2d4298f..8791fda 100644 (file)
@@ -21,6 +21,9 @@
        # make sure any BIOS call didn't re-enable interrupts
        cli
 
+       # just in case we were loaded from floppy, turn all floppy motors off
+       call motor_off
+
        mov $0x13, %ax
        int $0x10
 
@@ -304,6 +307,13 @@ wait:      in %dx, %al
        ret
 
 
+motor_off:
+       mov $0x3f2, %dx
+       in %dx, %al
+       and $0xf0, %al
+       out %al, %dx
+       ret
+
 logohack:
        # copy palette
        mov $logo_pal, %esi