Wednesday 20 October 2021

RAM-dump in Linux system

 

In detail about the RAM-dump in Linux system

Is divided into three sections based on how ramdump is generated, transferred and stored.

  1. The Support in the kernel to enter into ramdump mode when kernel crashes or freezes.
  2. Support in boot-loader to detect ramdump, wait for a host tool to initiate ramdump and send the data to host.
  3. A host tool which can receive data from device and save it on host PC file system.

Later you need to have bootloader support as well, it makes the decision whether to enter into ramdump mode not boot Linux normally.


Ramdump generation during the crash

The kernel panic notifier registered from the ramdump driver will be called by kernel. Ramdump driver do,

  1. Invoke cache sycn api to make sure all the content the ram is coherent.(flush_cache_all(), outer_flush_all())
  2. save core registers to ram
  3. save MMU registers
  4. write MAGIC_CRASH to SRAM regiter. Then do a reboot. Now boot-loader finds the MAGIC_CRASH in SRAM register and goes to ramdump mode.

Very detailed information about Ramdump Linux inspection.



Interview preparation

 DS & Algos




https://github.com/orrsella/soft-eng-interview-prep


DP:


https://leetcode.com/discuss/general-discussion/475924/my-experience-and-notes-for-learning-dp


Quick Recap:


https://leetcode.com/discuss/career/217868/My-notes-for-the-night-before-interview.


Comprehensive Guide:


Comprehensive-data-structure-and-algorithm-study-guide


  Grouping similar questions - but algorithm or data structure used by the solution might vary.




Group 1


https://www.techiedelight.com/find-elements-array-greater-than-elements-right/


https://www.techiedelight.com/replace-every-element-array-least-greater-element-right/


https://www.geeksforgeeks.org/count-of-larger-elements-on-right-side-of-each-element-in-an-array/


https://www.geeksforgeeks.org/count-smaller-elements-on-right-side/


https://www.techiedelight.com/previous-smaller-element/


https://www.techiedelight.com/next-greater-element-circular-array/


https://www.techiedelight.com/inversion-count-array/




Sorting Logic application


https://www.techiedelight.com/problems-solved-using-partitioning-logic-quicksort/


https://www.techiedelight.com/segregate-positive-negative-integers-using-mergesort/




Dynamic Programing


https://www.techiedelight.com/4-sum-problem/




Trees


https://leetcode.com/problems/binary-tree-maximum-path-sum


https://leetcode.com/problems/path-sum-iv/solution/


Kth Frequent elements.


Kth frequent elements in a stream.


LRU cache Implementation


All of the above can be done in O(1) time




String


https://www.techiedelight.com/check-given-string-rotated-palindrome-not/


https://www.techiedelight.com/longest-palindromic-substring-non-dp-space-optimized-solution/




Custom Sort:


https://www.programmersought.com/article/82237172611/