From owner-freebsd-questions Wed Feb 24 15:44:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from fisicc-ufm.edu (unknown [209.198.197.202]) by hub.freebsd.org (Postfix) with ESMTP id 8484314C3A for ; Wed, 24 Feb 1999 15:43:15 -0800 (PST) (envelope-from obonilla@fisicc-ufm.edu) Received: (from obonilla@localhost) by fisicc-ufm.edu (8.9.2/8.9.2) id LAA41672; Wed, 24 Feb 1999 11:58:13 -0600 (CST) (envelope-from obonilla) Date: Wed, 24 Feb 1999 11:58:13 -0600 (CST) From: Oscar Bonilla Message-Id: <199902241758.LAA41672@fisicc-ufm.edu> To: dan@jgl.reno.nv.us, grios@netshell.vicosa.com.br Subject: Re: assembly Cc: freebsd-questions@FreeBSD.ORG, grog@lemis.com In-Reply-To: <36D1BAB6.BB3F8701@netshell.vicosa.com.br> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I don't believe (i am sorry if i am wrong, but i am a beginner)! > If i use assembly i do not need to read a file via read API, i can > access the HD directly, without to check for access permissions, right ? > If so, i can hack a UNIX system (no matter which) using assembly! > > Am i wrong ? > YES! i know you've been replied more than once on this, but here goes my reply too. advice: get a book about operating systems and another book on computer architecture. look up the following: dual mode operation (kernel mode, user mode) protection address spaces memory translation assembler is a programming language, and as such is no different than C. i mean, the c compiler translates your C code to assembler and the assembles it using an assembler (as). Anything you can do in assembler you can do in C. the protection is not in the C compiler, is in the way the cpu runs your programs. in unix, the kernel runs in a higher level of protection than user programs. this means that some instruction are priviledged and can only be executed by the kernel. if you write a program in assembler that tries to write directly to the hard drive without using the system call interface (API as you called it) the cpu will say "hey! this is a priviledged operation this user program is trying to execute, better check what the kernel has to say about it" and inform the kernel via a trap. the kernel will happily kill your process. end of story. as i said before, get a book about OS's and CA. regards, -oscar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message