Johannes Zellner 8 сар өмнө
parent
commit
3d7f69c3d2
3 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 2 1
      boot.S
  2. 1 1
      disk.c
  3. 1 0
      kernel.ld

+ 2 - 1
boot.S

@@ -106,7 +106,8 @@ pm_start:
 	movw  %ax, %fs
 	movw  %ax, %gs
 	movw  %ax, %ss
-	movl  $0x10000, %esp
+	/* Stack above DMA buffer 0x20000-0x20200 so DMA does not overwrite stack */
+	movl  $0x20800, %esp
 	movl  $0x7e00, %eax
 	jmp   *%eax
 

+ 1 - 1
disk.c

@@ -6,7 +6,7 @@
 #define SECTOR_SIZE       512
 #define SECTORS_PER_TRACK 18
 #define HEADS             2
-#define DMA_BUF_ADDR      0x10000
+#define DMA_BUF_ADDR      0x20000
 
 /* FDC I/O ports */
 #define FDC_DOR   0x3F2

+ 1 - 0
kernel.ld

@@ -13,3 +13,4 @@ SECTIONS
 	.bss : { *(.bss .bss.*) *(COMMON) }
 	_end = .;
 }
+ASSERT(_end <= 0x20000, "Kernel too large would overwrite stack/DMA at 0x20000");