summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/core/cleanup.inc
blob: 300584c7e753866b873b29d3ad5ffeb1e92e80cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;; -----------------------------------------------------------------------
;;
;;   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
;;
;;   This program is free software; you can redistribute it and/or modify
;;   it under the terms of the GNU General Public License as published by
;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
;;   Boston MA 02111-1307, USA; either version 2 of the License, or
;;   (at your option) any later version; incorporated herein by reference.
;;
;; -----------------------------------------------------------------------

;;
;; cleanup.inc
;;
;; Some final tidying before jumping to a kernel or bootsector
;;

		section .text16
;
; cleanup_hardware:
;
;	Shut down anything transient.  *No segment assumptions*.
;	Preserves all registers.
;
cleanup_hardware:
		pushad
;
; Linux wants the floppy motor shut off before starting the kernel,
; at least bootsect.S seems to imply so.  If we don't load the floppy
; driver, this is *definitely* so!
;
		xor ax,ax
		xor dx,dx
		int 13h

%if 0		; This bug report has not been substantiated!
; Vmware crashes if we scroll in the decompressor!  Try to detect vmware
; and if it is Vmware, clear the screen...
		mov eax,'VMXh'
		xor ebx, ebx
		mov ecx, 10		; Get version
		mov dx, 'VX'
		in eax, dx
		cmp ebx, 'VMXh'
		jne .no_vmware

		mov ax,0x0003		; Set mode (clear screen/home cursor)
		int 10h
.no_vmware:
%endif

		call comboot_cleanup_api

		call timer_cleanup

		popad

		; If we enabled serial port interrupts, clean them up now
		jmp sirq_cleanup