java调用系统程序,从Java应用程序读取的文件是否会调用系统调用?

当应用程序请求访问文件系统路径时,通常会通过系统调用进入操作系统内核,例如在Java中打开、读写文件。内核负责文件系统的操作,并管理内存,将虚拟地址转换为物理地址。如果用户没有权限访问特定内存区域,操作会被终止;否则,如果页面在内存中,读写操作将在该页面上执行,否则页面从磁盘加载后重试。内存管理单元在执行读取指令时进行这些转换。
摘要由CSDN通过智能技术生成

My understanding is that a user application requesting a file system path (eg. /aFile) will invoke the File System and get back the virtual address of the requested file.

Then the application will attempt a read/write operation with that address as argument, that as a CPU instruction?

On execution of the read command the Memory Management Unit will translate that address into the phisical address, looking into a page table. In case the user has not privilege to access that memory location (where is that information carried?) the operation is aborted. Otherwise, if the physical address page is found in memory, the read/write operation is carried on it, otherwise the page is brought in from disk and the operation is repeated.

So, there seems to be no system call at all. Could someone correct possible mistakes in the above procedure detail?

解决方案

(typically) when you open/read/write a file in Java, a call is made to the OS kernel , aka. a system call,for opening/read/write that file. How that is done and the memory management involved is entierly in the hands of the kernel, but eventually bytes read from the file is copied back to a buffer supplied through the system call.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值