diff --git a/x86_64/bootsector.asm b/x86_64/bootsector.asm
index 86032ab73eb75928206371e0ccb52d7289a37ea3..1273e865e295f68f3d7ff1647d3e26545e7b9895 100644
--- a/x86_64/bootsector.asm
+++ b/x86_64/bootsector.asm
@@ -96,6 +96,69 @@ load:
     jc error
     ret
 
+  ; store some sectors to disk from a buffer in memory
+  ; buffer has to be below 1MiB
+  ; IN
+  ;   ax: start sector
+  ;   bx: offset of buffer
+  ;   cx: number of sectors (512 Bytes each)
+  ;   dx: segment of buffer
+  ; CLOBBER
+  ;   ax, bx, cx, dx, si
+  ; TODO rewrite to (eventually) move larger parts at once
+  ; if that is done increase buffer_size_sectors in startup-common to that (max 0x80000 - startup_end)
+  store:
+      cmp cx, 128
+      jbe .good_size
+
+      pusha
+      mov cx, 128
+      call store
+      popa
+      add ax, 128
+      add dx, 128 * 512 / 16
+      sub cx, 128
+
+      jmp store
+  .good_size:
+      mov [DAPACK.addr], eax
+      mov [DAPACK.buf], bx
+      mov [DAPACK.count], cx
+      mov [DAPACK.seg], dx
+
+          mov bx, [DAPACK.addr + 2]
+          call print_num
+
+          mov bx, [DAPACK.addr]
+          call print_num
+
+          mov al, '#'
+          call print_char
+
+          mov bx, [DAPACK.count]
+          call print_num
+
+          mov al, ' '
+          call print_char
+
+          mov bx, [DAPACK.seg]
+          call print_num
+
+          mov al, ':'
+          call print_char
+
+          mov bx, [DAPACK.buf]
+          call print_num
+
+          call print_line
+
+      mov dl, [disk]
+      mov si, DAPACK
+      mov ah, 0x43
+      int 0x13
+      jc error
+      ret
+
 error:
     mov si, errored
     call print
diff --git a/x86_64/config.asm b/x86_64/config.asm
new file mode 100644
index 0000000000000000000000000000000000000000..8e3b220c667dcf69501d18e04613ad0112937485
--- /dev/null
+++ b/x86_64/config.asm
@@ -0,0 +1,18 @@
+SECTION .text
+USE16
+
+align 512, db 0
+
+config:
+  .xres: dw 0
+  .yres: dw 0
+
+times 512 - ($ - config) db 0
+
+save_config:
+    mov eax, (config - boot) / 512
+    mov bx, config
+    mov cx, 1
+    xor dx, dx
+    call store
+    ret
diff --git a/x86_64/startup-common.asm b/x86_64/startup-common.asm
index 518410d9f4bf6311d01e465951e526d38caebc8a..70b9f961119630bbf9776a25dbb82f3fc4ba0985 100644
--- a/x86_64/startup-common.asm
+++ b/x86_64/startup-common.asm
@@ -83,6 +83,7 @@ finished_loading:
 
     jmp startup_arch
 
+%include "config.asm"
 %include "descriptor_flags.inc"
 %include "gdt_entry.inc"
 %include "unreal.asm"
diff --git a/x86_64/vesa.asm b/x86_64/vesa.asm
index 943e4eb61e95941569093747504e937b7d1b5284..b649e4b968203f38be05537be1a350fe35eb78ad 100644
--- a/x86_64/vesa.asm
+++ b/x86_64/vesa.asm
@@ -15,17 +15,13 @@ vesa:
     xor cx, cx
     mov [.minx], cx
     mov [.miny], cx
-    mov [.requiredx], cx
-    mov [.requiredy], cx
-    mov [.requiredmode], cx
+    mov [config.xres], cx
+    mov [config.yres], cx
 .findmode:
     mov si, [VBECardInfo.videomodeptr]
     mov ax, [VBECardInfo.videomodeptr+2]
     mov fs, ax
     sub si, 2
-    mov cx, [.requiredmode]
-    test cx, cx
-    jnz .getmodeinfo
 .searchmodes:
     add si, 2
     mov cx, [fs:si]
@@ -51,9 +47,9 @@ vesa:
     jb .searchmodes
 .testx:
     mov cx, [VBEModeInfo.xresolution]
-    cmp word [.requiredx], 0
+    cmp word [config.xres], 0
     je .notrequiredx
-    cmp cx, [.requiredx]
+    cmp cx, [config.xres]
     je .testy
     jmp .searchmodes
 .notrequiredx:
@@ -61,11 +57,11 @@ vesa:
     jb .searchmodes
 .testy:
     mov cx, [VBEModeInfo.yresolution]
-    cmp word [.requiredy], 0
+    cmp word [config.yres], 0
     je .notrequiredy
-    cmp cx, [.requiredy]
+    cmp cx, [config.yres]
     jne .searchmodes    ;as if there weren't enough warnings, USE WITH CAUTION
-    cmp word [.requiredx], 0
+    cmp word [config.xres], 0
     jnz .setmode
     jmp .testgood
 .notrequiredy:
@@ -95,7 +91,16 @@ vesa:
     int 0x16
     pop esi
     cmp al, 'y'
-    jne .searchmodes
+    je .setmode
+    cmp al, 's'
+    je .savemode
+    jmp .searchmodes
+.savemode:
+    mov cx, [VBEModeInfo.xresolution]
+    mov [config.xres], cx
+    mov cx, [VBEModeInfo.yresolution]
+    mov [config.yres], cx
+    call save_config
 .setmode:
     mov bx, [.currentmode]
     cmp bx, 0
@@ -114,12 +119,8 @@ vesa:
 
 .minx dw 640
 .miny dw 480
-.required:
-.requiredx dw 1024    ;USE THESE WITH CAUTION
-.requiredy dw 768
-.requiredmode dw 0
 
-.modeok db ": Is this OK?(y/n)",10,13,0
+.modeok db ": Is this OK? (s)ave/(y)es/(n)o",10,13,0
 
 .goodmode dw 0
 .currentmode dw 0