Bladeren bron

boot: STACK_SIZE is 1024 now

since https://github.com/torvalds/linux/commit/d594aa0277e541bb997aef0bc0a55172d8138340#diff-0af1468d3dc7f373d70011eda7be1592
Alexander Kuleshov 7 jaren geleden
bovenliggende
commit
220d3378f7
2 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. 1 1
      Booting/linux-bootstrap-1.md
  2. 5 3
      Booting/linux-bootstrap-2.md

+ 1 - 1
Booting/linux-bootstrap-1.md

@@ -432,7 +432,7 @@ Field name: loadflags
     functionality will be disabled.
 ```
 
-If the `CAN_USE_HEAP` bit is set, we put `heap_end_ptr` into `dx` (which points to `_end`) and add `STACK_SIZE` (minimum stack size, `512` bytes) to it. After this, if `dx` is not carried (it will not be carried, `dx = _end + 512`), jump to label `2` (as in the previous case) and make a correct stack.
+If the `CAN_USE_HEAP` bit is set, we put `heap_end_ptr` into `dx` (which points to `_end`) and add `STACK_SIZE` (minimum stack size, `1024` bytes) to it. After this, if `dx` is not carried (it will not be carried, `dx = _end + 1024`), jump to label `2` (as in the previous case) and make a correct stack.
 
 ![stack](http://oi62.tinypic.com/dr7b5w.jpg)
 

+ 5 - 3
Booting/linux-bootstrap-2.md

@@ -329,10 +329,12 @@ First of all `init_heap` checks the [`CAN_USE_HEAP`](https://github.com/torvalds
 or in other words `stack_end = esp - STACK_SIZE`.
 
 Then there is the `heap_end` calculation:
-```c
-    heap_end = (char *)((size_t)boot_params.hdr.heap_end_ptr + 0x200);
+
+```C
+     heap_end = (char *)((size_t)boot_params.hdr.heap_end_ptr + 0x200);
 ```
-which means `heap_end_ptr` or `_end` + `512`(`0x200h`). The last check is whether `heap_end` is greater than `stack_end`. If it is then `stack_end` is assigned to `heap_end` to make them equal.
+
+which means `heap_end_ptr` or `_end` + `512` (`0x200h`). The last check is whether `heap_end` is greater than `stack_end`. If it is then `stack_end` is assigned to `heap_end` to make them equal.
 
 Now the heap is initialized and we can use it using the `GET_HEAP` method. We will see how it is used, how to use it and how it is implemented in the next posts.