<PAGE>

                                                                   Exhibit 10.24

                                    EXHIBIT B

                    PROMISSORY NOTE SECURED BY DEED OF TRUST

$100,000.00                                              Santa Clara, California
                                                                    May 17, 2002

      FOR VALUE RECEIVED, the undersigned, William G. Harris ("Borrower"),
promise to pay to XenoPort, Inc., a Delaware corporation (the "Company"), or
order, the principal amount of One Hundred Thousand Dollars ($100,000.00). The
outstanding principal amount shall bear interest from such date until paid at a
rate of four and ninety-nine one hundredths percent (4.99%) per annum. All
payments shall be credited first to accrued interest and then to principal.

      The outstanding principal amount and any interest accrued thereon shall be
due and payable to the holder hereof at 3410 Central Expressway, Santa Clara,
California 95051, or such other place as the holder hereof may designate, upon
the earlier of the following dates (collectively, "Maturity Events"):

      (i) ninety (90) days following the date of termination of the employment
of Borrower with the Company, whether voluntary or involuntary, and whether with
cause or without cause, except for a termination described in Section 5(b) of
the Restricted Stock Purchase Agreement between the Borrower and the Company
dated on or about January 11, 2002, in which case twelve (12) months following
the date of such termination shall be the applicable Maturity Event;

      (ii) the date of any sale, conveyance, assignment, alienation or any other
form of transfer, whether voluntary or involuntary, of that certain real
property commonly known as 120 Croydon Way, Woodside, California (the
"Property"), or any part thereof or interest therein; except that the following
transfers of the Property shall not be deemed to be a Maturity Event:

            a) a transfer upon the death of Borrower to Borrower's surviving
spouse (provided the surviving spouse is an obligor hereunder) or to Borrower
upon the death of Borrower's surviving spouse;

            b) a transfer by an obligor hereof whereby such obligor's spouse
becomes a co-owner of the Property;

            c) a transfer resulting from a decree of dissolution of the marriage
or legal separation of Borrower and Borrower's spouse or from a property
settlement agreement incidental to such a decree which requires the obligor
spouse to assume responsibility for the obligations under this Note and the Deed
of Trust (hereinafter defined) and pursuant to which Borrower or Borrower's
spouse (whoever is the obligor) becomes the sole owner of the Property; or

            d) or a transfer by an obligor hereof into an inter vivos trust in
which an obligor hereof is a beneficiary; or

<PAGE>

      (iii) the seventh anniversary of the date of this Note.

      In the event that any of the following occurs, then unless otherwise
prohibited by law, the holder hereof shall have the option, without demand or
notice, to declare the entire outstanding principal balance of this Note,
together with all accrued and unpaid interest thereon to be immediately due and
payable: (i) Borrower's default in the payment of principal or interest when due
pursuant to the terms hereof; (ii) Borrower's default in its performance of any
obligation contained in the deed of trust encumbering the Property and securing
this Note (the "Deed of Trust") or any other deed of trust, security agreement
or other agreement (including any amendment, modification or extension thereof)
which may hereafter be executed by Borrower for the purpose of securing this
Note; (iii) any representation or warranty contained in this Note, the Deed of
Trust, or any other agreement or instrument executed in connection with the loan
proves to have been false or misleading in any material respect; (iv) Borrower's
default in its obligation to pay any indebtedness or to perform any other
obligation which is secured by a deed of trust or other lien on the Property or
default under any deed of trust securing such indebtedness; (v) Borrower's
default in its obligation to pay any indebtedness evidenced by any promissory
note executed by Borrower and payable to the holder hereof or there occurs any
other default under any deed of trust, mortgage or other document securing
repayment of such indebtedness; or (vi) the amount of the indebtedness
encumbering the Property secured by a deed of trust, lien or other encumbrance
that is senior to the Deed of Trust is increased over the amount of such
indebtedness existing as of the date of this Note.

      The principal amount evidenced by this Note shall be used by Borrower to
purchase the Property which shall become the primary residence of Borrower. This
Note shall be secured by the Deed of Trust given by Borrower to the Company.

      In the event any amount owed by Borrower pursuant to this Note is not paid
when due, such unpaid amount shall bear interest from the due date until paid at
a rate equal to the lower of: (i) ten percent (10%) per annum; or (ii) the
maximum rate permitted by law. After such due date, all payments shall be
credited first to accrued interest and then to principal.

      Notwithstanding anything to the contrary contained in this Note, so long
as Borrower remains employed with the Company, on each anniversary of the date
of this Note, the Company shall automatically forgive all interest then accrued
pursuant to the terms of this Note; provided that in the event that the
employment of Borrower with the Company terminates prior to the forgiveness of
all of the interest obligations under this Note, the unforgiven, unpaid interest
then accrued hereunder shall become due and payable according to the provisions
above with respect to Maturity Events.

      If an action is instituted for collection of this Note, the Borrower agree
to pay court costs and reasonable attorneys' fees incurred by the holder
thereof.

      This Note may be amended or modified, and provisions hereof may be waived,
only by the written agreement of Borrower and the holder hereof. No delay or
failure by the holder hereof in exercising any right, power or remedy hereunder
shall operate as a waiver of such right, power or remedy, and a waiver of any
right, power or remedy on any one occasion shall not operate as a bar or waiver
of any such right, power or remedy on any other occasion. Without

<PAGE>

limiting the generality of the foregoing, the delay or failure by the holder
hereof for any period of time to enforce collection of any amounts due hereunder
shall not be deemed to be a waiver of any rights of the holder hereof under
contract or under law. The rights of the Company under this Note are in addition
to any other rights and remedies which the holder hereof may have.

      This Note shall be governed by and construed in accordance with the laws
of the State of California.

      This Note may be prepaid at any time without penalty.

      THIS NOTE, THE DEED OF TRUST AND ALL RELATED DOCUMENTATION ARE EXECUTED
VOLUNTARILY AND WITHOUT ANY DURESS OR UNDUE INFLUENCE ON THE PART OR BEHALF OF
THE PARTIES HERETO, WITH THE FULL INTENT OF CREATING THE OBLIGATIONS AND
SECURITY INTERESTS DESCRIBED HEREIN AND THEREIN. THE PARTIES ACKNOWLEDGE THAT:
(a) THEY HAVE READ SUCH DOCUMENTATION; (b) THEY HAVE BEEN REPRESENTED IN THE
PREPARATION, NEGOTIATION AND EXECUTION OF SUCH DOCUMENTATION BY LEGAL COUNSEL OF
THEIR OWN CHOICE OR THAT THEY HAVE VOLUNTARILY DECLINED TO SEEK SUCH COUNSEL;
(c) THEY UNDERSTAND THE TERMS AND CONSEQUENCES OF THIS NOTE, THE DEED OF TRUST
AND ALL RELATED DOCUMENTATION AND THE OBLIGATIONS THEY CREATE; AND (d) THEY ARE
FULLY AWARE OF THE LEGAL AND BINDING EFFECT OF THIS NOTE, THE DEED OF TRUST AND
THE OTHER DOCUMENTS CONTEMPLATED BY THIS AGREEMENT. WITHOUT LIMITING THE
GENERALITY OF THE FOREGOING, BORROWER HEREBY ACKNOWLEDGES THAT THE COMPANY HAS
MADE NO REPRESENTATION OR WARRANTY TO BORROWER CONCERNING THE INCOME TAX
CONSEQUENCES OF THE LOAN TO BORROWER, AND BORROWER SHALL BE SOLELY RESPONSIBLE
FOR ASCERTAINING AND BEARING SUCH TAX CONSEQUENCES. BORROWER FURTHER
ACKNOWLEDGES THAT (i) THE COMPANY MAY, IN ITS SOLE DISCRETION, DETERMINE THAT IT
IS REQUIRED UNDER THE INTERNAL REVENUE CODE OF 1986, AS AMENDED (THE "CODE"),
AND THE RULES AND REGULATIONS PROMULGATED BY THE INTERNAL REVENUE SERVICE
("IRS") THEREUNDER, TO IMPUTE INTEREST ON THE PRINCIPAL OF THIS NOTE AT THE RATE
SET BY THE IRS, (ii) THE AMOUNT OF ANY SUCH IMPUTED INTEREST WOULD BE DEEMED TO
BE COMPENSATION INCOME TO EMPLOYEE WHICH WOULD BE SUBJECT TO TAX WITHHOLDING,
AND (iii) IF SO DETERMINED BY THE COMPANY, THE COMPANY WOULD REPORT AND WITHHOLD
THE REQUIRED AMOUNT OUT OF THE CURRENT COMPENSATION PAID TO EMPLOYEE IN
ACCORDANCE WITH THE CODE AND THE RULES AND REGULATIONS PROMULGATED THEREUNDER.

BORROWER:                               COMPANY:

Signature: /s/ William G. Harris        Signature: /s/ Ronald W. Barrett
           -------------------------               -----------------------------
             William G. Harris                            Ronald W. Barrett
                                                          President & CEO

<PAGE>

      THIS NOTE IS SUBJECT TO SECTION 2924i OF THE CALIFORNIA CIVIL CODE, WHICH
PROVIDES THAT THE HOLDER OF THIS NOTE SHALL GIVE WRITTEN NOTICE TO THE TRUSTOR,
OR HIS SUCCESSOR IN INTEREST, OF PRESCRIBED INFORMATION AT LEAST 90 AND NOT MORE
THAN 150 DAYS BEFORE ANY BALLOON PAYMENT IS DUE.