virtio-gpu: fix crashes upon warm reboot with vga mode
[qemu/ar7.git] / tests / migration / x86-a-b-bootblock.s
blobb1642641a796225e2280597f64ddaade8e5e5627
1 # x86 bootblock used in migration test
2 # repeatedly increments the first byte of each page in a 100MB
3 # range.
4 # Outputs an initial 'A' on serial followed by repeated 'B's
6 # run tests/migration/rebuild-x86-bootblock.sh
7 # to regenerate the hex, and remember to include both the .h and .s
8 # in any patches.
10 # Copyright (c) 2016 Red Hat, Inc. and/or its affiliates
11 # This work is licensed under the terms of the GNU GPL, version 2 or later.
12 # See the COPYING file in the top-level directory.
14 # Author: dgilbert@redhat.com
17 .code16
18 .org 0x7c00
19 .file "fill.s"
20 .text
21 .globl start
22 .type start, @function
23 start: # at 0x7c00 ?
24 cli
25 lgdt gdtdesc
26 mov $1,%eax
27 mov %eax,%cr0 # Protected mode enable
28 data32 ljmp $8,$0x7c20
30 .org 0x7c20
31 .code32
32 # A20 enable - not sure I actually need this
33 inb $0x92,%al
34 or $2,%al
35 outb %al, $0x92
37 # set up DS for the whole of RAM (needed on KVM)
38 mov $16,%eax
39 mov %eax,%ds
41 mov $65,%ax
42 mov $0x3f8,%dx
43 outb %al,%dx
45 # bl keeps a counter so we limit the output speed
46 mov $0, %bl
47 mainloop:
48 # Start from 1MB
49 mov $(1024*1024),%eax
50 innerloop:
51 incb (%eax)
52 add $4096,%eax
53 cmp $(100*1024*1024),%eax
54 jl innerloop
56 inc %bl
57 jnz mainloop
59 mov $66,%ax
60 mov $0x3f8,%dx
61 outb %al,%dx
63 jmp mainloop
65 # GDT magic from old (GPLv2) Grub startup.S
66 .p2align 2 /* force 4-byte alignment */
67 gdt:
68 .word 0, 0
69 .byte 0, 0, 0, 0
71 /* -- code segment --
72 * base = 0x00000000, limit = 0xFFFFF (4 KiB Granularity), present
73 * type = 32bit code execute/read, DPL = 0
75 .word 0xFFFF, 0
76 .byte 0, 0x9A, 0xCF, 0
78 /* -- data segment --
79 * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
80 * type = 32 bit data read/write, DPL = 0
82 .word 0xFFFF, 0
83 .byte 0, 0x92, 0xCF, 0
85 gdtdesc:
86 .word 0x27 /* limit */
87 .long gdt /* addr */
89 /* I'm a bootable disk */
90 .org 0x7dfe
91 .byte 0x55
92 .byte 0xAA