Ghost Kernel

How filesystem transactions work 2016/03/17, 15:48:21

I'm doing some work on the system documentation. For this I made a diagram that shows how filesystem transactions are working in Ghost. The following explanation applies to the read operation when a driver task is involved. Filesystem drivers in Ghost run in user space, therefore they run in their own task.

Basics

  • a filesystem node has a delegate that has the implementation of the underlying filesystem operations (read, write, open etc.)
  • a filesystem node is mapped to a process via a file descriptor
  • the transaction store holds a status for each running transaction
  • a waiter object is used to store waiting information for one task and decide whether a task shall keep sleeping during scheduling

Process visualization

Process explanation

  1. requesting task creates the request structure and performs the read system call
  2. the system call handler looks up the filesystem node for the given file descriptor
  3. the system call handler creates a transaction handler that is responsible for keeping track of the transaction status and performing the requested operations
  4. the transaction handler tells the delegate to start a transaction
  5. the requesting task is put to sleep and a filesystem transaction waiter object is appended
  6. the delegate starts a new transaction in the transaction store (retrieving the transaction id)
  7. the delegate asks the driver task to perform the read operation
  8. the delegate sets the transaction status to "waiting"
  9. the driver task now does anything that is necessary to perform the read operation, like querying the hard disk etc.
  10. the driver task sets the status of the transaction to "finished" once its done (using the fs-set-transaction-status-syscall)
  11. the waiter object is continously checking the transaction store whether the transaction has finished. while the driver performs the transaction, the waiter tells the scheduler to keep waiting
  12. once the transaction status is "finished" the waiter object tells the transaction handler to finish the operation
  13. the transaction handler finishes the transaction by writing the result data into the requesting tasks request structure
  14. the waiter is removed from the requesting task

The request object in the requesting task now contains the result of the operation.

Comments

Write a comment...
  • edgegling 2023/03/04, 17:54:43

    Moreover, the testing revealed the patient s CYP2C19 UM status with the star alleles 1 wildtype and 17 increased function, and a CYP2C9 IM status with the star alleles 1 wildtype and 2 decreased function <a href=https://buycialis.boats>canadian pharmacy cialis</a> 5 year course

  • Duhododay 2023/02/07, 06:46:03

    Erin, USA 2022 06 06 02 08 07 <a href=http://brandviagra.top>over counter viagra</a>

  • Bowreoste 2023/02/02, 01:54:02

    This is not a foregone conclusion, because full length wild type progesterone receptor is constitutively nuclear, unlike the glucocorticoid receptor <a href=https://cialis.autos>cialis for sale in usa</a>

  • amoccurry 2023/01/29, 23:24:15

    I told Martha about the problem and she treated me with acupuncture <a href=http://lasix.mom>buy lasix australia</a> Tobias TvGMCfsYbWsZWcWoJU 6 19 2022

  • Spoguem 2023/01/25, 10:30:25

    <a href=http://stromectol.skin>oral ivermectin</a> Comparisons of HIFU for Fibroid Ablation to Myomectomy

  • whatill 2022/12/14, 07:47:11

    <a href=http://accutane.one>accutane pill</a> com 20 E2 AD 90 20Manfaat 20Obat 20Viagra 20 20Cobra 20Viagra 20130 20Mg cobra viagra 130 mg We as a society must take these victims seriously and be absolutely clear to perpetrators that if they groom and abuse a child for sex they will be caught and they will spend a very long time in jail

  • elarmasag 2022/11/17, 23:25:08

    Hale, GE, Hughes, CL, Burger, HG, et al <a href=https://clomid.mom/>side effects of clomid male</a> Together, these studies establish a new paradigm of HDAC inhibitor based therapy for hematologic malignancies in animals and man

  • clolionge 2022/11/15, 23:21:00

    13A is a dose matrix showing inhibition of the BVD 523 dabrafenib combination in A375 cells using the CellTiter Glo cell viability assay <a href=https://stromectol.ink/>where can i buy stromectol in the usa</a>

  • Ayan Agrawal 2016/03/30, 07:10:26

    Nice Explanation. It has helped me alot to understand about the filesystem. Keep Up. :)

    • Max 2016/04/04, 11:29:39

      It is quite theoretical and can be used to understand the code better when inspecting it :) A more extensive documentation is in progress.

Cancel