pxe, tftp: Unify UDP send and use pbuf memory
[syslinux.git] / core / cleanup.inc
blob300584c7e753866b873b29d3ad5ffeb1e92e80cb
1 ;; -----------------------------------------------------------------------
2 ;;
3 ;;   Copyright 2007-2008 H. Peter Anvin - All Rights Reserved
4 ;;
5 ;;   This program is free software; you can redistribute it and/or modify
6 ;;   it under the terms of the GNU General Public License as published by
7 ;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ;;   Boston MA 02111-1307, USA; either version 2 of the License, or
9 ;;   (at your option) any later version; incorporated herein by reference.
11 ;; -----------------------------------------------------------------------
14 ;; cleanup.inc
16 ;; Some final tidying before jumping to a kernel or bootsector
19                 section .text16
21 ; cleanup_hardware:
23 ;       Shut down anything transient.  *No segment assumptions*.
24 ;       Preserves all registers.
26 cleanup_hardware:
27                 pushad
29 ; Linux wants the floppy motor shut off before starting the kernel,
30 ; at least bootsect.S seems to imply so.  If we don't load the floppy
31 ; driver, this is *definitely* so!
33                 xor ax,ax
34                 xor dx,dx
35                 int 13h
37 %if 0           ; This bug report has not been substantiated!
38 ; Vmware crashes if we scroll in the decompressor!  Try to detect vmware
39 ; and if it is Vmware, clear the screen...
40                 mov eax,'VMXh'
41                 xor ebx, ebx
42                 mov ecx, 10             ; Get version
43                 mov dx, 'VX'
44                 in eax, dx
45                 cmp ebx, 'VMXh'
46                 jne .no_vmware
48                 mov ax,0x0003           ; Set mode (clear screen/home cursor)
49                 int 10h
50 .no_vmware:
51 %endif
53                 call comboot_cleanup_api
55                 call timer_cleanup
57                 popad
59                 ; If we enabled serial port interrupts, clean them up now
60                 jmp sirq_cleanup